VEX IQ (2nd gen) API Reference#

Welcome to the VEX IQ (2nd gen) API Reference. This site explains the Blocks, Python, and C++ commands available in VEXcode IQ.

Use this reference to learn what a command does, what information it needs, what it reports or returns, and how it can be used in a project.

This API information applies when using either:

API Sections#

  • Blocks - Learn about the blocks available in VEXcode IQ, including what each block does, what its inputs mean, and how it can be used in a project.

  • Python - Learn about the Python methods, functions, parameters, return values, and examples used in VEXcode IQ. Python API information can also support projects written in Visual Studio Code with the VEX Visual Studio Code Extension.

  • C++ - Learn about the C++ classes, objects, constructors, member functions, parameters, return values, and examples used in VEXcode IQ. C++ API information can also support projects written in Visual Studio Code with the VEX Visual Studio Code Extension.

  • VEXcode Tutorials - Find tutorials and supporting resources for learning how to use VEXcode IQ.

How to Use This Reference#

  1. Choose the section for the coding language or resource you are using.

  2. Use the sidebar or search bar to find a device, category, block, command, method, or class.

  3. Read the description to understand what the command does and when it is useful.

  4. Check the parameters to see what inputs are needed and what options are available.

  5. Review the example to see one way the command can be used in a project.

For text-based examples in Python or C++, select the Copy button to copy the example, then paste it into your coding environment.

Tips for Using the API#

  • Start with the device or category you are working with, such as Drivetrain, Brain, Controller, or Sensors.

  • Read the description before copying an example so you understand what the command is meant to do.

  • Check parameter tables carefully. Small changes to inputs can change how the robot behaves.

  • Use examples as a starting point, then change values, directions, ports, or names to match your own project.