Computer Science Level 1 - Blocks

Unit 6 - Knowing Your Location

# Lesson 2: Drive to Number ‘5’

In this Lesson, the VR Robot will drive to the number ‘5’ and back to the number ‘1’ on the Number Grid Map Playground!

Notice that the VR Robot will be traveling along the X axis with X values increasing to move to the number ‘5’ on the Number Grid Map Playground.

The VR Robot will drive to the location of the number ‘5’ on the Number Grid Map Playground. However, before the VR Robot can navigate to that number, the VR Robot has to be told where that number’s location is. Beginning at the center of the Playground, the coordinates of number ‘5’ are (-100, -900).

• To begin, the VR Robot needs to be facing the number ‘5.’ Drag in a [Turn for] block to the workspace.
• Drag the [Drive] non-waiting block into the workspace.
• Attach a [Wait until] block beneath the [Drive] block.
• The [Wait until] block accepts Boolean conditions. Just like the Distance Sensor Unit, this project will use the conditionals to drive through the Number Grid Map Playground. Drag the <Greater than> Boolean reporter block into the [Wait until] block.
• Note that the <Greater than> block is used instead of the <Less than> block because the VR Robot is driving to the right from the left side of the Playground. The VR Robot is starting at a X-value of -900 millimeters (mm). As the VR Robot drives forward, the X-values increase.
• Drag the (Position of Robot) block into the <Greater than> block.