Conditional Statements with VEX V5
Introduction: Autonomous Orchard Tractor
Robot Configuration: Conditional Statements
Lesson: Conditional Statements
Mini-Challenge: Orchard Tractor Part 1
Robot Configuration: Looped Conditional Statements
Lesson: Looped Conditional Statements
Mini-Challenge: Orchard Tractor Part 2
Activity: The Buggy Code
Robot Configuration: Optical Sensor
Lesson: Decisions with the Optical Sensor
Mini-Challenge: Fill in the Blanks
Robot Configuration: Embedded Conditional Statements
Lesson: Triple Sensor Line Tracking
Activity: Looping for Encoder Degrees
Unit Challenge: Orchard Tractor Part 3
Unit Quiz: Conditional Statements
Back to Overview
Overview
In this activity, you will use the Optical Sensor underneath the robot's claw. The following steps tell you where to attach the Optical Sensor and how to configure it in VEXcode.
Attaching the Optical Sensor
We have attached the Optical Sensor to the center of the robot's claw. To attach the sensor, you will need the following materials:
Mounting the Sensor
First, use two screws and keps nuts to secure the Angle Coupler Gusset underneath the claw.
Then, use the remaining screws and keps nuts to secure the. Optical Sensor onto the Angle Couper Gusset.
Then, use the remaining screws and keps nuts to secure the. Optical Sensor onto the Angle Couper Gusset.
How to Test the Optical Sensor
Step 1: Open a New Project in VEXcode
Open the VEXcode app. Select File > New Project. You can name the project "OpticalDecisions".
VEXcode New Project Instructions
Step 2: Configure the Drivetrain
Step 3: Configure the Optical Sensor
Configure your Optical Sensor within VEXcode by completing the following steps.
- Select the Robot Configuration button located in the top right of VEXcode
- Select “Add a device”
- Select "Optical"
- Choose Port 20
- Rename it "ClawOptical"
- Click Done