VEX V5 - Drive Challenge
VEX V5 - Drive Challenge
Drive Challenge
To finish off the introduction to drive code, we set up a challenge for the robot to accomplish. The challenge is for the robot to start from a set position, drive to a specific destination, make a full turn, and then drive back to the starting position. This incorporates all aspects of basic drive code and will lead to the use of functions later.
The challenge can be modified as necessary to increase or decrease the difficulty. Below is example code of what the challenge will consist of. Make sure to set up visible markers for the robot to reach its destination using tape, vex pieces, etc.
LM.spin(fwd,50,rpm); //left and right motors spin forward at a set rpm for 2 seconds using wait RM.spin(fwd,50,rpm); wait(2000,msec); LM.stop(); //motors are set to stop once a specific distance is achieved RM.stop(); wait(1000,msec); //1 second delay for the robot so motion does not overlap and start too soon LM.spin(fwd,50,rpm); //point turn by spinning each motor a different direction at the same speed RM.spin(reverse,50,rpm); task::sleep(1350); //turn for a set amount of time LM.stop(); RM.stop(); LM.spin(fwd,50,rpm); RM.spin(fwd,50,rpm); wait(2000,msec); LM.stop(); RM.stop();
Back to the course
Lessons
Lesson 1: Competitive Robotics
60 Minutes
Lesson 2: Game Analysis and Rules
60 Minutes
Lesson 3: Strategy and Game Play
60 Minutes
Lesson 4: Fasteners and Tools
60 Minutes
Lesson 5: Design Rules
60 Minutes
Lesson 6: DriveBase
60 Minutes
Lesson 7: Lift and Claw
60 Minutes
Lesson 8: Gears and Gear Ratios
60 Minutes
Lesson 9: Custom Build
60 Minutes
Lesson 12: Autonomouse Code and Functions
60 Minutes
Lesson 14: Sensors and Improved Auton
60 Minutes
Lesson 15: Tournament
60 Minutes