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:
- To find out more information about the block, open the Help and then select the [Turn for] block.
- Make sure you have the hardware required, your engineering notebook, and VEXcode V5 downloaded and ready.
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:
- Are the smart cables fully inserted into all of the motors?
- Is the Brain turned on?
- Is the battery charged?
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.
Complete the following steps to open the template project:
- Open the File menu.
- Select Open Examples.
- 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.
Step 3: Turn Right
- Add the [Turn for] block to the {When started} block in the programming area.
- 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.
- Connect the robot to your computer or tablet. The Brain icon in the toolbar turns green once a successful connection has been made.
- Click the Download button on the toolbar to download the Turn project to the Robot Brain.
- 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
Step 5: Wait, then Turn Left
- 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!
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.