Creating VS Code Projects for VEX IQ (2nd gen)

This article provides an overview of the process for creating VEX IQ (2nd gen) projects in the VEX Visual Studio Code (VS Code) Extension. Projects in the VEX VS Code Extension can be created in two ways - by creating a new project from an example template or importing an existing VEXcode project.

Creating a new project for VEX IQ (2nd gen)

  • Launch Visual Studio Code on the computer. Click on the VEX icon on the VS Code Activity Bar.
    The VEX Robotics Extension icon on the side menu of VS Code is highlighted.
  • Click on the New Project Button under PROJECT ACTIONS in the Primary Side Bar.
    The VEX Robotics Extension has been selected and it shows options for creating and importing projects. The New Project button is highlighted.
  • The Create a New VEX Project window will prompt. Click on the IQ 2nd Generation icon to select the Project Platform for the VEX IQ (2nd gen) project.
    The New Project button has been selected, and VEX platform options are shown. The listed options include IQ (2nd gen), EXP, and V5. The IQ (2nd gen) option is highlighted.
  • Select Python or C/C++ as the Project Language. Click on the Python icon to choose Python as the programming language for the VEX IQ (2nd gen) project, or click on the C/C++ icon to choose C/C++.
    The IQ (2nd gen) option has been selected, and now programming language options are shown. The listed options include Python and C/C++.
  • Select a Template/Example Project for creating the new VEX IQ (2nd gen) project. 
    • Find the Template/Example Project by rotating the Mouse Scroll Wheel, dragging the slider of the Scrollbar, or using the Search Bar to filter the list of sample projects. 
    • Click on the icon of the appropriate Template/Example Project.
      Note: The Template/Example Project contains sample code and robot configuration that is used to get the project started.
      The programming language option has been selected, and now Template/Example projects are shown. This menu can be scrolled down to view the complete list of projects.
  • Set the Project Name, Description, and Location for the new VEX IQ (2nd) gen project.
    • Type the name of the project in the Text Box under Project Name.
      Note: The project name will be used for the name of the top-level folder for the project. It will also be the name displayed on the VEX device screen once the application has been downloaded to the robot. 
      The IQ2 Empty Template Project has been selected, and now the Project Name field is highlighted. The default name reads myProjectName.
    • (Optional) Type the description of the project in the Text Box under Description.
      Note: The project description will also be displayed on the device’s screen under the project information. 
      The IQ2 Empty Template Project has been selected, and now the Description field is highlighted.
    • (Optional) If you want to save the project in a different location than the default project folder, scroll down the Create a New VEX Project window and click on the Browse Button to select the location for the project folder on the computer.
      Note: The default project location is set to the default project folder found in the extension global settings.
      The IQ2 Empty Template Project has been selected, and now the Browse button is highlighted that can be used to select the Save Location.
    • Click on the Create button to create the project. The VS Code window will start refreshing.
  • Once the VS Code window refresh is complete, the project for VEX IQ (2nd) gen is created in the VEX VS Code Extension. To view and develop the project code, click on src under the project name in the Side Bar.
    VS Code with a new VEX IQ Python project created and opened. The side menu is open and the folder named src is highlighted.
  • Click on main.py (if the project is a Python project) or main.cpp (if the project is a C/C++ project) under src in the Side Bar.
    VS Code with the src folder opened and the main.py file highlighted inside.
  • The code of the selected Template/Example Project will be shown in the Editor area, where we can develop and edit the created project for VEX IQ (2nd gen).
    VS Code with the main.py file opened and the Python code shown in the editor. The user is now ready for VEX Python programming in VS Code.

Import an existing VEXcode IQ (2nd gen) project

  • Launch Visual Studio Code on the computer. Click on the VEX icon on the VS Code Activity Bar.
    The VEX Robotics Extension icon on the side menu of VS Code is highlighted.
  • Click on the Import Project Button under PROJECT ACTIONS in the Primary Side Bar.
    The VEX Robotics Extension has been selected and it shows options for creating and importing projects. The Import Project button is highlighted.
  • The Import Project window will prompt. Select the VEXcode IQ project file to import and click on the Open Button.
    Note: The supported VEXcode project file types for VEX IQ are: 
    •  .iqcpp (VEXcode IQ C/C++ project) 
    • .iqpython ( VEXcode IQ Python project)
    Note: Only the projects that are configured to use IQ (2nd gen) can be imported. If you try to import a VEXcode IQ project that is configured for IQ (1st gen), the import process will fail.
    Saved VEX projects are shown in the user's files in File Explorer. There is a C/C++ project and a Python (2nd gen) project listed.
  • Set the Project Name, Description, and Location for the imported project.
    • (Optional) If you want to change the name of the imported project, type the new name of the project in the Text Box under Project Name.
      Note: The project name will be used for the name of the top-level folder for the project. It will also be the name displayed on the VEX device screen once the application has been downloaded to the robot.
      The previously saved VEX project has been selected to be imported, and now the Project Name field is highlighted.
    • (Optional) Type the description of the project in the Text Box under Description.
      Note: The project description will also be displayed on the device’s screen under the project information. 
      The previously saved VEX project has been selected, and now the Description field is highlighted.
    • (Optional) If you want to save the project in a different location than the default project folder, click the Browse Button to select the location for the project folder on the computer.
      Note: The default project location is set to the default project folder found in the extension global settings.
      The previously saved VEX project has been selected, and now the Browse button is highlighted that can be used to change the Saved Location.
    • Click on the Import button to import the project. The VS Code window will start refreshing.
  • Once the VS Code window refresh is complete, the VEXcode IQ project is imported into the VEX VS Code Extension. To view and develop the project code, click on src under the project name in the Side Bar.
    VS Code with a previously saved VEX C/C++ project successfully imported and opened. The side menu is open and the folder named src is highlighted.
  • Click on main.py (if the imported project is a Python project) or main.cpp (if the imported project is a C/C++ project) under src in the Side Bar.
    VS Code with the src folder opened and the main.cpp file highlighted inside.
  • The code of the imported project will be shown in the Editor area, where we can modify or remix the imported project for VEX IQ (2nd gen).
    VS Code with the main.cpp file opened and the C/C++ code shown in the editor. The user is now ready for VEX C/C++ programming in VS Code.

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

Last Updated: