Moving Your Robot#

Moving Your Robot

This tutorial walks you through using the drive for block to move your robot forward and backward in VEXcode V5. By the end, you’ll have a project that drives your robot forward, then in reverse.

  1. Make sure your robot is configured with a Drivetrain, so you see the Drivetrain blocks in the toolbox. See Configuring a Drivetrain if you haven’t added one yet.

Screenshot of the toolbox with the Drivetrain category open, showing its drive and turn blocks.
  1. Attach two drive for blocks below the when started block.

Two drive for blocks connected below when started.#
    when started
        drive [forward v] for (200) [mm v] ▶
        drive [forward v] for (200) [mm v] ▶
  1. On the second block, change the direction parameter to reverse.

Screenshot of the second drive for block's direction dropdown open, showing forward and reverse options.
  1. Make sure your robot is connected to VEXcode, then select Download to download the project to the Brain.

Screenshot of the VEXcode toolbar with the Download button highlighted.
  1. Select Run to run the project. The robot will drive forward, then drive the same distance in reverse.

Screenshot of the VEXcode toolbar with the Run button highlighted.