Programming a Sequence - VEXcode IQ
Let's program a sequence!
In this activity, you will outline a plan for the sequence of movements that your robot will need to make in order to grab, lift, and move an object.
You will first review two tutorial videos about programming the claw and arm. Then you will identify the correct sequence of steps to approach, grab, and lift an object, and plan that project using pseudocode.
You will then create, download, and run the project using the pseudocode that helped you plan!
-
Make sure you have the hardware required, your engineering notebook, and VEXcode IQ downloaded and ready.
Quantity | Materials Needed |
---|---|
1 |
VEX IQ Super Kit |
1 |
VEXcode IQ |
1 |
Engineering Notebook |
1 |
Meter stick or ruler |
1 |
Clawbot (Drivetrain 2-motor) template example project |
1 |
Aluminum can or empty water bottle |
Step 1: Preparing for the Exploration
Before you begin the activity, do you have each of these items ready? The Builder should check each of the following:
- Are all of the motors and sensors plugged into the correct ports?
- Are the smart cables fully inserted into all of the motors and sensors?
- Is the Brain turned on?
- Is the battery charged?
- Is the Radio inserted into the Robot Brain?
Step 2: Start Planning a Path
Before you begin planning the path that your robot will take, first review the Moving the Arm and Open the Claw tutorial videos in VEXcode IQ.
- Moving the Arm Tutorial Video
- Open the Claw Tutorial Video
Now, in your engineering notebook, use pseudocode (Google Doc / .docx / .pdf ) to write the correct sequence of steps to approach, grab, and lift an object like an empty water bottle or aluminum can.
- Parts of this problem to keep in mind:
- First, you will need to measure in millimeters how far away the object is from the robot. You will need this to determine how far forward and in reverse the robot should move.
- Identify how many degrees the claw will have to open and close depending on its range of motion and how large the object is. For more help, refer to the previous page in the Play section.
- Hint: Open the Device Menu and see how many degrees the claw will close with the object inside.
- Identify how far up in degrees the arm will raise to carry the object.
- When you approach an object, the claw should already be opened. If you approach an object with the claw closed, the closed claw could knock the object over.
- The robot will also have to grasp the object in its claw, raise the object up, move in reverse to relocate the object, and then place the object back down and release it.
Step 3: Programming a Sequence
- Open the Clawbot (Drivetrain 2-motor) template example project.
- For help opening an example project, view the Use Example Projects and Templates tutorial video in VEXcode IQ Blocks.
- Rename and save the project as 'Sequence'.
- For help renaming and saving a project, view the Naming and Saving Your Project tutorial in VEXcode IQ.
- Now, create your project using your pseudocode. First outline your project using comments to insert your pseudocode. The example shown below is a reference. Degree and distance measurements may be different depending on how far away your object is and its size.
- Use the [Drive], [Spin for], and [Spin to position] blocks to create the project based on the pseudocode.
Don't forget to reset the Arm Motor's position to 0 and to include a 3-second timeout for the Claw Motor.
Use the image below as an example of how to organize the project. The following project is not complete but you should completely program yours. - After your project is complete, predict what it will do. Write your predictions in your engineering notebook.
Step 4: Test the Project!
Now that you have created a project to approach, grab, and lift and object - let's test it!
- Download and Run your Sequence project. For help, view the Download and Run a Project tutorial video in VEXcode IQ. It will have the following icon:
Did your project run as intended? Write your observations in your engineering notebook comparing your pseudocode to your final project and answer the following questions:
- Did your project have your robot to grab, lift, and move an object?
- Why is this sequence of movements important?