Creating a Project to Drive Forward and Backward in VEXcode Pro V5

This program shows how to program the V5 Clawbot to move forward and backward using VEXcode Pro V5.

main.cpp

How it Works

This program uses the driveFor(distance, units) command to drive for a specified distance.

You can specify the units of distance by using a numeric value. You can specify units by using inches or mm (millimeters).

You can use a positive numeric value to move your robot forward and a negative numeric value to move the robot backward.

Steps executed in the program:

  1. The drivetrain will drive six inches forward. 
  2. The program will wait one second before executing the next line of code.
  3. The drivetrain will drive six inches in reverse.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: