Blocks#
This guide provides detailed information on how to use Blocks in VEXcode V5. 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.
Parameters: Screenshots showing all the available parameters for that block with expanded drop-downs.
Example: Provides an image demonstrating how to use the block in VEXcode.
Example Block Entry#
turn for#
The turn for block turns the drivetrain left or right for a specific number of degrees using the current turn velocity.
turn [right v] for [90] degrees ▶
Parameters |
Description |
|---|---|
direction |
The direction in which the robot turns:
|
angle |
The number of degrees the robot turns, as an integer or decimal. |
expanding arrow |
By default, this is a waiting block, so the drivetrain will finish turning before running the next block. To make the drivetrain start turning and immediately run the next block right away, expand the block to say and don’t wait. |
Example
when started
[Turn left, then turn around to the right.]
turn [left v] for [90] degrees ▶
turn [right v] for [180] degrees ▶
Blocks in Subpages#
Some blocks are located on dedicated subpages linked from the main page. Each subpage focuses on a specific group of devices or functions—for example, the Motion subpage contains all motor-related blocks, while the Logic subpage includes logic-related ones.