C++#

This guide provides detailed information on how to use the C++ commands in VEXcode V5. Here, you will learn how to read and understand each command, with comprehensive descriptions, parameters, and usage examples.

Understanding the Command Entries#

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

  • Command Name and Signature: This is the name of the command and its parameters.

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

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

  • Parameters Table: Lists and describes the parameters that the command accepts.

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

  • Example: Provides a sample code snippet demonstrating how to use the command.

Example Command Entry#

Drivetrain.setRotation()#

The Drivetrain.setRotation() command sets the rotation for the Drivetrain.

This is a non-waiting command and allows the next command to run without delay.

Parameters

Description

value

The new value to use for rotation.

units

Optional. A valid rotationUnit. The default is degrees.

Returns: None.

// Set the value of rotation to 180 degrees.
Drivetrain.setRotation(180);

Commands in Subsections#

Some commands are found in specific subsections that pertain to their particular sensor or functionality. For example, commands related to Timers, Bumper Sensors, Optical Sensors, or etc. will be grouped accordingly. Refer to these subsections for detailed information on those commands.