Moving Forward and Backward#

Once you have a Drivetrain added to your robot in the Devices menu, you can start to code with it.

Add a drive for Block#

To move your robot’s Drivetrain forward and backward, use the drive for block, found in the Drivetrain category.

The drive for block.#
conducir [adelante v] por (200) [mm v] ▶

Connect the drive for block to the when started block.

Screenshot of a drive for block being connected below a when started block.

Configure the Parameters#

Set the Distance#

Select the number in the block to type in the distance you want the Drivetrain to travel, including decimals.

Screenshot of the drive for block, with the distance value highlighted.

Set the Direction#

Select forward to open the drop-down menu, and choose whether to move the Drivetrain forward or in reverse.

Screenshot of the drive for block's direction drop-down menu open, showing forward and reverse options.

Set the Units#

Select mm to open the drop-down menu, and choose whether to move in millimeters or inches.

Screenshot of the drive for block's units drop-down menu open, showing mm and inches options.

Set Whether to Wait#

Select the arrow to expand the block to say and don’t wait. This makes the project continue to the next block right away, instead of waiting for the Drivetrain to finish moving first.

Screenshot of the drive for block's expand arrow highlighted, showing the and don't wait option.