Blocks#

This guide provides detailed information on how to use the Blocks in VEXcode IQ (1st gen). Here, you will learn how to read and understand each block, with comprehensive descriptions, parameters, and usage examples.

Understanding the Block Entries#

Each block entry in the API Reference includes the following components:

  • Block Name and Image: This is the name of the block and an image of the block.

  • Description: A brief explanation of what the block does.

  • Blocking/Non-Blocking: Indicates whether the block waits for completion before moving to the next block.

  • Parameters: Screenshots showing all the available parameters for that block with expanded drop-downs.

  • Returns: Describes what the block returns, if applicable.

  • Example: Provides an image demonstrating how to use the block in VEXcode.

Example Block Entry#

Drive#

The Drive block is used to move the Drivetrain in the specified direction forever, until a new drivetrain command is used, or the project is stopped.

This is a non-waiting block and allows any subsequent blocks to execute without delay.

A notched blue coding block with the text "drive forward" written in white. There is a dropdown menu on the right side labeled "forward.

Select which direction for the drivetrain to move in.

A notched blue coding block with a yellow highlight around it containing the text "drive forward" written in white. There is a dropdown menu on the right side labeled "forward." Below the block, an expanded dropdown menu shows the options "forward" (with a checkmark) and "reverse.

In this example, the robot will drive forward for 2 seconds, then stop.

A stack of coding blocks starting with a yellow "when started" block at the top. Below it, a blue block reads "drive forward," with "forward" in a dropdown menu. Next, an orange block reads "wait 2 seconds," with the number "2" in a white oval. The sequence ends with a blue block that reads "stop driving.

Blocks in Subsections#

Some blocks are found in specific subsections that pertain to their particular sensor or functionality. For example, blocks related to timers, sensors, or motors will be grouped accordingly. Refer to these subsections for detailed information on those blocks.