Understanding Waiting and Non-waiting Blocks in VEXcode IQ

Non-waiting blocks

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.

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

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

Waiting blocks

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 IQ Clawbot needs to retrieve a cube, you can use waiting blocks to have the robot carry out each behavior individually.

VEXcode IQ Clawbot on an IQ field with a blue cube placed in front of it.

VEXcode IQ blocks project that used 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.

Blocks that Can Wait or Not Wait

VEXcode IQ 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.

Previously shown VEXcode IQ 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.

 

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: