Blocks#
This guide provides detailed information on how to use the Blocks in VEXcode CTE. 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#
The Move 6-Axis Arm to Position block is used to move the 6-Axis Arm to a specified set of coordinates.
This is can be a non-blocking or blocking block depending on if the and don’t wait option is used.
move [arm v] to position x: (120) y: (120) z: (75) [mm v] ▶
Select which unit for the coordinates to use: millimeters or inches.
You can select the arrow to expand and don’t wait - this will allow subsequent blocks to run while the 6-Axis Arm moves.
move [arm v] to position x: (120) y: (120) z: (75) [mm v] ◀ and don't wait
In this example, the 6-Axis Arm will move to the coordinates (120, 120, 75) in millimeters.
when started :: hat events
move [arm v] to position x: (120) y: (120) z: (75) [mm v] ▶
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.