Downloading and Running a VEX Project in VS Code

Once a VEX project is programmed in VS Code, users need to build and download it onto a VEX device, and then run the project to enable the VEX Robot to execute the program developed in VS Code. 

How to build a VEX Project in VS Code

Building a VEX Project ensures the correctness of the program's syntax and prepares the code for downloading and running on the specific VEX platform.

  • (Optional) Select the VEX project for the VEX Extension to build when multiple VEX projects exist inside the workspace.
    Note: VS Code supports multiple workspace projects.
    • Click on the Project Selector Icon on the Toolbar.
      Note: The Project Selector displays the name of the selected project.

      Diagram illustrating the features and functionalities of the V5 VS Code Extension, showcasing its integration and tools for enhanced coding experience.


    • A Quick Pick List will prompt with all the valid VEX projects inside the workspace. Click on the list item of the VEX project that you want the VEX Extension to build.
      Note: A valid VEX project is a project that is created or imported by the VEX Extension. VEXcode or VEXcode Pro projects opened in the editor will not be considered a valid VEX Project and will need to be imported.

      Screenshot of the VEX V5 Code Extension interface in Visual Studio Code, showcasing features and tools available for programming VEX robotics.
  • (Optional) Select the Python file as the source code for the VEX Extension to build when a Python Project is selected and there are multiple Python files located in the workspace directory.
    Note: The VEX Extension only supports single Python file downloads currently.
    • Click on the Python File Selector Icon on the Toolbar.
      Note: The Python File Selector Icon will appear on the Toolbar only when a VEX Python project is selected. It displays the name of the selected Python file.

      Screenshot of the VEX V5 VS Code Extension interface, showcasing various features and tools available for programming VEX robotics, including code editing, debugging options, and project management.


    • A Quick Pick List will prompt with all Python files located in the workspace directory. Click on the list item of the Python File to choose it as the source code you want the VEX Extension to build.

      Screenshot of the VEX V5 VS Code Extension interface, showcasing features and options available for programming VEX robotics, including code editing tools and project management functionalities.
  • Click on the Build Icon on the Toolbar to build (compile) the project.
    Note: The Build Icon will appear on the Toolbar when there is no VEX device connected to the computer.

    Screenshot of the Vex V5 VS Code Extension interface, showcasing features and tools available for programming VEX robotics, including code editing options and project management tools.

How to download a VEX Project in VS Code

  • Connect the VEX Brain to the computer using a Micro-USB cable (VEX V5 Brain) or a USB-C cable (VEX EXP Brain and IQ 2nd Brain) and power on the VEX Brain.

    Diagram illustrating the features and functionalities of the VEX V5 Code Extension for VS Code, highlighting key components and their interactions within the programming environment.
  • (Optional) Select the VEX device for the VEX Extension to connect when multiple VEX devices are connected to the computer.
    • Click the Device Picker Icon on the Toolbar.
      Note: The  Device Picker will appear on the Toolbar only when a VEX device is connected to the computer. It displays the Icon representing the connected VEX device type (a Brain or a Controller) and the Brain name.
      Note: If a VEX Controller is connected to the computer but does not have a radio link to a VEX Brain, no Brain name will be displayed next to the Controller Icon.

      Diagram illustrating the features and functionalities of the VEX V5 VS Code Extension, including code editing, debugging, and project management tools for robotics programming.
    • A Quick Pick List will prompt with all the VEX devices connected to the computer. Click on the list item of the VEX device that you want the VEX Extension to connect.

      Screenshot of the VEX V5 Code Extension interface in Visual Studio Code, showcasing features and tools available for programming VEX robotics.
  • Select the Slot the VEX project will be downloaded to on the VEX Brain.
    Note: The VEX Brain has eight Slots to store downloaded programs. Users can choose which Slot to use by selecting the Slot within VS Code. Keep in mind that downloading will replace the previous program using the selected Slot.
    • Click on the Slot Selector Icon on the Toolbar.

      V5 Category Description: Visual Studio Code Extension interface showcasing features and functionalities, including code editing tools and extensions available for enhanced development experience.
    • A Quick Pick List will prompt with the available user program Slots 1-8. Click on the list item of the Slot that you want the VEX project to be downloaded to on the VEX Brain.

      Screenshot of the VEX V5 Code Extension interface in Visual Studio Code, showcasing various features and tools available for programming VEX robotics.
  • Click on the Download Icon on the Toolbar to build the VEX project, and if successful, download the project to the VEX Brain.
    Note: When the VEX device is connected to the computer, the Build Icon on the Toolbar changes to the Download Icon.

    Screenshot of the VEX V5 Code Extension interface in Visual Studio Code, showcasing features and tools available for programming VEX robotics.

How to run and stop a VEX Project in VS Code

When the VEX project is downloaded to a VEX Brain and the Vex Brain is still plugged into the computer, users can run the project or stop running the project in VS Code.

  • Click the Play Icon on the Toolbar To run the user project downloaded to the VEX Brain in the VS Code.
    Note: This method for running the VEX project will only work if the VEX Robot is still plugged into the computer and is planned to remain stationary.

    Screenshot of the VEX V5 Code Extension interface in Visual Studio Code, showcasing features and tools for programming VEX robotics.
  • Click the Stop Icon on the Toolbar to stop running the user program on the VEX Brain.
    Note: This method will only work if the VEX Robot is still plugged into the computer.

    Screenshot of the VEX V5 Code Extension interface in Visual Studio Code, displaying various coding features and options for programming VEX robotics.

It is advised to run and stop the VEX project from the VEX Robot Brain while unplugged from the computer if the robot is supposed to drive. For helpful information about running user programs with the VEX Brain, please check out this article for the VEX V5 Brain, this article for the VEX EXP Brain, and this article for the VEX IQ (2nd) Brain.

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

Last Updated: