Starting, Downloading, and Running a VEXcode IQ C++ Project

Starting and downloading C++ projects in VEXcode IQ is easy.


How to Start a C++ Project

VEXcode IQ application icon.

Launch VEXcode IQ.

New Blocks project opened in VEXcode IQ.

The platform defaults to the Blocks interface.

VEXcode IQ Toolbar with the File menu open and the New Text Project option highlighted. New Text Project is the second option in the menu, below New Blocks Project.

Select ‘File,’ then ‘New Text Project’ to open the text interface.

VEXcode IQ Select a Project Language prompt that has options for Python or C++. Python can only be run on 2nd gen IQ, but C++ projects work on both 1st gen and 2nd gen IQ. Either language can be selected to open a new project, or below there is a Cancel button that will close the menu.

Select C++ from the Project Language window.

New C++ project opened in VEXcode IQ.

The C++ interface will open.


How to Build a C++ Project

This section will show you how to create a basic C++ project using commands from the Toolbox. The project outlined here will drive the IQ Clawbot forward for 200 millimeters (mm).

VEXcode IQ Toolbar with the File menu open and the Open Examples option highlighted. Open Examples is the fifth option in the menu, below New Blocks Project, New Text Project, Open, and Open Recent.

Select ‘File’ then ‘Open Examples” to open a template project.

Clawbot Drivetrain 2 motor example project thumbnail. The example project is shown twice and labeled to indicate that the project has a 1st gen version and a 2nd gen version.

Select the Clawbot (Drivetrain 2-motor) template. Templates are blank projects with preset device configurations.

VEXcode IQ with a template Example Project opened, including configured devices and code comments with a description of the project.

Notice that a set of project comments open in the workspace. You will add commands after the comments.

VEXcode IQ with the Clawbot Drivetrain 2 motor template Example Project opened. A specific blank line of code at line 22 is highlighted, inside of the main function and directly below the commment that reads Begin project code.

Select enter at the end of the last line of code (line 21). This should create the next numbered line (line 22). This is where you will start adding code to the project.

VEXcode IQ with the Drive for command highlighted in the C++ Toolbox.

Now you can add commands from the Toolbox. Select the Drive for command.

VEXcode IQ with the Clawbot Drivetrain 2 motor template Example Project opened. The previously blank line of code now has a Drive for command in it that reads Drivetrain.driveFor(forward, 200, mm).

Drag the Drive for command into the workspace and place it on the last line of the project (line 22).


How to Download and Run a C++ Project

VEXcode IQ Toolbar with the project name field highlighted and renamed to Drive Forward. To the right of the project name a label reads Saved.

First, name and save your C++ project. View one of the following articles for detailed information on how to save a VEXcode IQ C++ project:

VEXcode IQ with the Slots dropdown menu opened. There are 4 available slots for downloading projects to the Brain, and the first slot is highlighted.

Then, choose which of the Brain’s slots you will download the project to. To do this, select the ‘Slot’ button on the Toolbar.

VEXcode IQ Toolbar with the green Brain icon highlighted, indicating that the Brain is connected.

Next, connect the Brain to your device (Directly via Micro-USB or via VEX Controller) and check that the Brain icon is green.

VEXcode IQ Toolbar with the Download icon highlighted in between the Brain and Run icons.

Select the ‘Download’ button to download the project to the Brain. The project will download to the chosen slot.

VEXcode IQ Toolbar with the Run icon highlighted in between the Download and Stop icons.

Finally, select ‘Run’ to start the project while the robot is still connected to your computer.

VEXcode IQ 2nd gen Brain screen is shown with the Drive Forward project's options opened and the Run button selected.VEXcode IQ 1st gen Brain screen is shown with the Programs menu opened and the DriveForward program selected.

Or, disconnect the Brain from your device and run the project on the IQ Brain.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: