Understanding Waiting and Non-waiting Blocks in VEXcode V5

Non-waiting blocks

VEXcode V5 blocks project that consists of a When started block, a Drive forward block, and a Stop driving block.

Non-waiting blocks have the stack continue even if the block’s behavior is not yet complete.

The “drive” block is a good example of a non-waiting block. In the example below, the robot doesn’t move because the “drive” block begins but then the “stop driving” block stops it before the motors can move.

Non-waiting blocks are useful when you want to perform multiple behaviors at the same time.

Waiting blocks

VEXcode V5 Clawbot on a game field with a purple cube game piece in front of it.
VEXcode V5 blocks project that uses Spin for and Drive for blocks, both of which can be expanded to be non-waiting. The project reads When started, spin ClawMotor open for 90 degrees, and then drive forward for 6 inches. Next, spin ClawMotor close for 90 degrees, spin ArmMotor up for 180 degrees, and then drive reverse for 6 inches.

Waiting blocks pause the rest of the stack until that block’s behavior has been completed.

Most waiting blocks are found among the Motion and Drivetrain blocks.

If a VEX V5 Clawbot needs to retrieve a cube, you can use waiting blocks to have the robot carry out each behavior individually.

Blocks that Can Wait or Not Wait

Previously shown VEXcode V5 blocks project that now has two of the Spin for blocks expanded to be non-waiting. The project now reads When started, spin ClawMotor open for 90 degrees and don't wait, and then drive forward for 6 inches. Next, spin ClawMotor close for 90 degrees, spin ArmMotor up for 180 degrees and don't wait, and then drive reverse for 6 inches.

VEXcode V5 lets users change the following waiting blocks to non-waiting blocks with one click: “spin for,” “spin to position,” “drive for,” “turn for,” and “turn to heading”.

By changing the block for opening the claw to non-waiting and changing the block for raising the arm to non-waiting, the Clawbot drives forward while the claw opens and drives in reverse while the arm raises.

This approach to retrieving a cube is better in competition settings because it saves time.

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

Last Updated: