Welcome to the API Reference Site for VEX IQ (2nd gen)#

Discover everything you need to start coding with VEXcode IQ (2nd gen), using Blocks, Python, and C++. This guide will help you navigate the site and make the most of the available resources.

This API information applies when using either:

API Sections#

How to Use the API Reference#

  1. Choose Your Language: Decide whether you want to use Blocks, Python, or C++ for your project.

    • For Blocks, navigate to the Blocks page.

    • For Python, navigate to the Python page.

    • For C++. navigate to the C++ page.

  2. Browse or Search: Use the navigation menu or search bar to locate specific commands or blocks.

  3. Read the Descriptions: Each API function includes a description that explains its purpose, parameters, and any important notes.

  4. Review the Examples:

    • Blocks: Visual examples of blocks will help you understand how to use them in your projects.

         when started :: hat events
         [Drive forward, then stop.]
         drive [forward v]    
         wait (2) seconds
         stop driving
      
    • Python: Copy-and-paste code snippets demonstrate how to write Python commands in VEXcode IQ (2nd gen).

      # Drive forward then stop
            drivetrain.drive(FORWARD)
            wait(2, SECONDS)
            drivetrain.stop()
      
      
    • C++: Copy-and-paste code snippets demonstrate how to write C++ commands in VEXcode IQ (2nd gen).

      int main() {
             // Initializing Robot Configuration. DO NOT REMOVE!
             vexcodeInit();
             // Drive forward then stop
             Drivetrain.drive(forward);
             wait(2, seconds);
             Drivetrain.stop();
          }
      
      
  5. Experiment and Modify: Try out the example code in your projects. Modify it to fit your needs and observe the effects.

Tips for Success#

  • Start Simple: Begin with basic projects to get comfortable with VEXcode.

  • Read the API Reference: Explore the API reference to understand the available functions and their operations.

  • Practice Regularly: The more you code, the more proficient you’ll become with the platform.

Happy coding, and welcome to VEXcode IQ (2nd gen)!