CS Level 1 - VEXcode VR Blocks

Unit 2 - Moving Your Robot

# Lesson 3: Turning the VR Robot

Now that you have knocked over the first castle in the Castle Crasher Playground, you will need the VR Robot to turn to knock over another. This Lesson will walk you through the steps to turn the VR Robot and knock over two buildings on the Castle Crasher Playground.

## Learning Outcomes

• Identify how to use the [Turn for] block to turn the VR Robot right or left.
• Identify how to use the [Turn to heading] block to turn the VR Robot to a given compass heading.

### Rename the Project

• Rename the project by selecting the project name box.
• Enter the new project name Unit2Lesson3, and select “Save.”

### Turn Right or Left

The [Turn for] block rotates the VR Robot a given number of degrees. This example will have the VR Robot drive forward to knock over the center building, reverse back to the start, then turn and knock over the building in the bottom right corner on the Castle Crasher Playground.

To make a VR Robot turn at different speeds, the turn velocity can be increased or decreased using the [Set turn velocity] block.

• Drag in the [Turn for] block and attach it beneath the [Drive for] block. Set the parameters of the [Turn for] block to turn right 90 degrees.
1. Note: This project has the [Set drive velocity] and [Set turn velocity] blocks added and set to 100%. These are optional blocks.
• Drag in the [Drive for] block and attach it below the [Turn for] block. Set the parameters of the [Drive for] block to 700 millimeters (mm).
• Select the “Open Playground” button to launch the Castle Crasher Playground if it is not already open.
• Select the “Start” button to test the project.
• Watch the VR Robot drive forward and collide with the center building before reversing back to the start. The VR Robot will then turn right 90 degrees and drive forward to collide with the building at the bottom right corner of the Castle Crasher Playground.

Select the Next button to continue with the rest of this Lesson.