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.

      Project Selector icon is highlighted on the VS Code toolbar. The Project Selector shows the name of the selected project, and in this example it reads IQ_Test.


    • 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.

      VS Code search bar with a Quick Pick List of saved VEX projects. In this example, there is only one VEX project and it reads IQ_Test.
  • (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.

      Python File Selector icon is highlighted on the VS Code toolbar. The Python File Selector shows the name of the selected Python file, and in this example it reads main.py.


    • 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.

      VS Code search bar with a Quick Pick List of all of the Python files in this VEX project. In this example, there is only one Python file and it reads main.py.
  • Click on the Build Icon on the Toolbar to build (compile) and download the project.
    Note: The Build Icon will appear on the Toolbar when there is no VEX device connected to the computer.

    Build icon is highlighted on the VS Code toolbar. This can be clicked to compile and download the project when there is no connected VEX device.

How to download a VEX Project in VS Code

  • Connect the VEX Brain to the computer using a USB-C cable and power on the VEX Brain.

  • (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.

      Device Picker icon is highlighted on the VS Code toolbar. The Device Picker shows the connected device's type and name, and in this example it reads IQ Brain(IQ).
    • 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.

      VS Code search bar with a Quick Pick List of all of the connected VEX devices. In this example, there is only one connected VEX device and it reads IQ2 Brain.
  • 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.

      Slot Selector icon is highlighted on the VS Code toolbar. The Slot Selector shows the selected Slot on the connected VEX Brain to download to, and in this example it reads Slot 1.
    • 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.

      VS Code search bar with a Quick Pick List of all of the available Slots on the connected VEX Brain. In this example, there are eight available slots.
  • Click on the Download Icon on the Toolbar to build the VEX project, and if successful, download the project to the VEX Brain.

    Download icon is highlighted on the VS Code toolbar. This can be clicked to download the project to the selected Slot on a connected VEX Brain.

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.

    Play icon is highlighted on the VS Code toolbar. This can be clicked to run the downloaded project on a connected VEX Brain.
  • 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.

    Stop icon is highlighted on the VS Code toolbar. This can be clicked to stop running the downloaded project on a connected VEX Brain.

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 more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: