Skip to main content

Programming Turning Right and Left - Blocks-based

Speedbot is ready to turn!

This exploration will give you the tools to be able to start creating some cool projects for your Speedbot to follow.

  • VEXcode V5  that will be used in this exploration:

VEXcode IQ Turn for block set to turn right for 90 degrees.

  • To find out more information about the block, open the Help and then select the [Turn for] block.

Help in VEXcode open showing the Help for the Turn for block. The Help icon in the upper right corner is highlighted, illustrating what to select to open the Help Menu for a block.

  • Make sure you have the hardware required, your engineering notebook, and VEXcode V5 downloaded and ready.
Materials Required:
Quantity Materials Needed
1

Speedbot Robot

1

Charged Robot Battery

1

VEXcode V5

1

USB Cable (if using a computer)

1

Engineering Notebook

Step 1: Preparing for the Exploration

Before you begin the activity, do you have each of these items ready? Check each of the following:

Step 2: Start a New Project

Before you begin your project, select the Speedbot (Drivetrain 2-motors, No Gyro) - Template project. The template project contains the Speedbot's motor configuration. If the template is not used, your robot will not run the project correctly.

VEXcode V5 Toolbar with the File menu open and Open Examples highlighted in a red box. Open Examples is the fourth menu item beneath New Blocks Project, New Text Project, and Open.

Complete the following steps to open the template project:

  • Open the File menu.
  • Select Open Examples.

SpeedBot (Drivetrain two motors, No Gyro) template icon, illustrating which template project to select for this activity.

  • Select and open the Speedbot (Drivetrain 2-motors, No Gyro) template project.
  • Since we will be using the [Turn for] block, rename your project Turn.
  • Save your project.
  • Check to make sure the project name Turn is now in the window in the center of the toolbar.

    VEXcode V5 Toolbar displaying the project name 'Turn', illustrating which menu should be used to change the project's name.

Step 3: Turn Right

VEXcode IQ project starting with a When Started block followed by a Turn for block set to 'turn right for ninety degrees'.

  • Add the [Turn for] block to the {When started} block in the programming area.

VEXcode V5 Toolbar with the Slot menu opened to the left of the project name. The dropdown menu lists all of the available slots, from one to eight. The first slot is called out with a red arrow.

  • Click on the Slot icon. You can download your project to one of the four available slots in the Robot Brain. Click on the number 1.

VEXcode V5 Toolbar with a red box around the green Brain icon, in between the Controller and Download buttons.

  • Connect the robot to your computer or tablet. The Brain icon in the toolbar turns green once a successful connection has been made.

VEXcode V5 Toolbar with a red box around the download icon, in between the Brain and Run buttons.

  • Click the Download button on the toolbar to download the Turn project to the Robot Brain.

V5 Brain screen reads Home at the top. Turn is listed as the project in slot 1, beneath the Drive settings button. The program icon must be pressed to select the project.

  • Check to make sure your project has downloaded to the Speedbot's Brain by looking at the Robot Brain’s screen. The project name should be listed in slot 1.
  • Run the project on the Speedbot robot by making sure the project is selected and then press the Run button.

Step 4: Turn Left

The dropdown menu on the VEXcode Turn for block, showing how to change the block's direction parameter from right to left.

  • Change the [Turn for] to display left instead of right.
  • Download the project.
  • Run the project on the Speedbot robot by making sure the project is selected and then press the Run button.

Step 5:  Wait, then Turn Left

 

VEXcode V5 project beginning with a When Started block. Next is a Wait block with a time parameter of three seconds, lastly is the Turn For block set to turn left for ninety degrees.

  • Add a [Wait] block before the [Turn for] block. This will tell the robot to wait before turning left.
  • Insert three seconds into the [Wait] block. This tells the robot to wait three before turning.
  • Download the project.
  • Run the project on the Speedbot robot by making sure the project is selected and then press the Run button.

Step 6: Complete the Security Camera Challenge!

A SpeedBot with three circles drawn around it, indicating directions for turning. Three movements are shown and labeled, first turning to the right, then the left, then the right and repeating the left to right steps three times.
Security Camera Challenge Layout

In the Security Camera Challenge, the robot must start by turning to the right 90 degrees. The robot will then turn to the left 180 degrees then right 180 degrees “scanning” just like a security camera. The robot will then repeat turning 180 degrees to the left and 180 degrees to the right an additional two more times. Thus, the robot will scan 180 degrees three times total.

Before programming the robot, plan out the robot's path and behaviors in your engineering notebook.

After completing the Security Camera Challenge, you will be able to combine forward and backwards movements with additional robot behaviors to complete even more advanced challenges.