This article is an overview of the VEX Visual Studio Code Extension UI(User Interface). The extension supports the development of C++ and Python projects for VEX IQ 2nd Generation, EXP, and V5 platforms.

Screenshot showing the complete VEX VS Code UI layout. The Activity Bar and Side Bar are on the left side of the screen, the Toolbar and Terminal are on the bottom side of the screen, and the editor fills the rest of the screen.

UI Components

There are 3 major components to the VEX VS Code Extension.

  1. Toolbar
  2. Activity Bar and Side Bar
  3. Terminal Panel

Toolbar

The toolbar gives users a quick way to interact with VEX VS Code extension projects VEX Brains, and VEX Controllers. The toolbar is only active when a valid VEX project is open in VS Code. A valid VEX project is a project that is created or imported by the extension. Opening a VEXcode or VEXcode Pro project is not valid and will need to be imported.

VS Code Toolbar with VEX Extension icons that can be used to quickly interact with connected VEX devices and projects. The VEX features include the Device Picker, the Slot Selector, the Build & Download icon, the Play icon, the Stop icon, the Project Selector, and the Python File Selector.

Device Picker

Device Picker icon is highlighted on the VS Code toolbar. In this example it reads VEX_EXP.

The device picker has two main functions. First, it displays a brain or controller icon representing the connected VEX Device type.

VS Code search bar with a Quick Pick List of all of the connected VEX devices. In this example, there is a V5 Brain, a V5 Controller, and an EXP Controller listed.

Second, when the device list icon is clicked, a quick pick list appears with all of the connected VEX Devices. The user can select which device the extension will connect to.
The current connected device will always appear at the top of the list followed by all other devices sorted by device type(Brain or Controller) and platform(IQ 2nd Generation, EXP, and V5).

VS Code search bar with a Quick Pick List item shown to provide detail. The item reads MyBrain, V5 Brain, User COM8, Comm COM7.

Each device item contains the Brain Name, Platform, Device type and device path information.

VS Code search bar with a Quick Pick List item shown to provide detail. The item is a V5 Controller, but the background is grayed out and there is no Brain name listed. This indicates that this Controller does not have a radio link to a Brain.

V5 Controller item with a blue background to indicate that this Controller does have a radio link to a Brain.

Important

If a controller is connected to a computer, but does not have a radio link to a brain, no brain name will be displayed next to the list item or device list status bar icon.

Slot Selector

Slot Selector icon is highlighted on the VS Code toolbar. In this example it reads Slot 1.

The slot selector icon allows the user to pick which slot the extension will download or play a user program on.

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.

When the slot selector icon is clicked, a quick pick list appears with the available user program slots 1-8.

Build/Download

Build icon.Download icon.

The Build/Download icon changes functions if a VEX Brain or a VEX Controller is connected.

Build icon.

If a VEX Device is not connected then the build icon is shown. When clicked, the project will only build.

Download icon.

If a VEX Device is connected, then the download icon is shown. When clicked, the project will build and if successful, will be downloaded to the VEX Device.

Play

Play icon.

The play icon, when clicked, runs the user program in the selected slot.

Stop

Stop icon.

The stop icon, when clicked, stops a user program.

Selected Workspace

Project Selector is shown on the VS Code toolbar. In this example it reads EXPTestProject.

VS Code supports multi workspace projects. The project selector allows users to switch between VEX projects when multiple exist inside the workspace.

VS Code search bar with a Quick Pick List of saved VEX projects. In this example, there is one Python project listed and one C++ project listed.

When the project selector icon is clicked, a quick pick list appears with all valid projects.

Important
If a project is not valid, it will not be shown in the project quick pick list. A project is not valid unless it has been created or imported by the VEX VS Code Extension.

Python File Selector icon is shown on the VS Code toolbar. In this example it reads main.py.

Python File Selector(Python Only)
When a VEX python project is selected the python file selector will appear in the toolbar. Python for VEX only supports single file downloads currently.

VS Code search bar with a Quick Pick List of all of the Python files in this VEX project. In this example, there are three Python files, each in a different file location.


When the icon is clicked, a quick pick list appears with all python files located in the workspace directory.
The python file selector allows the user to switch between python source files(.py)

VEX Activity Bar and Sidebar

Screenshot that shows the VS Code Activity Bar and the Side Bar opened to the VEX View. VEX View has options for creating and importing projects above, the VEX Device Info menu below, and a feedback menu at the bottom.

Projects Actions

Project Actions section of the VEX Extension View. This section has two buttons that read New Project and Import Project.

The vex activity bar contains the Project Actions view and the VEX Device Info view.

The Project actions view is used for creating a new project or importing an existing VEXcode or VEXcode Pro Project.

For more information about creating a new project, check out this article!

Version information is also displayed in the bottom left and right hand corners of the view.

Important
If a VEXcode or VEXcode Pro project is open in the editor then it will not be considered a valid VEX Project, the project needs to be imported using the Import button in the VEX sidebar.

VEX Device Info

VEX Device Info section of the VEX Extension View is shown with a list of all connected devices and specific info about each one. In this example, an IQ (2nd gen) Brain and its downloaded programs are shown. The Controller listing reads Controller, not linked.VEX Device Info section is shown again but now the Controller listing reads Controller, linked.

The VEX Device Info view gives the user an overview of the connected VEX Brain or VEX Controller. VEXos Version, serial port path, user program, and device information can all be found in this view. Other functions such as VEXos firmware updates, screen shots, setting brain name and settings team number can also be performed through this view as well.

System Information

System folder and its contents are shown and highlighted underneath the Brain folder. The system folder has data about the Brain, and the data reads VEXos 1.0.1.0, name VEX_EXP, team 000000, id 0EC83725, and Python 1.0.0.7.

The system information provides a brief overview of a connected VEX Device. This includes a device’s VEXos version, Brain name, team number, Brain ID, and python runtime version information.

Serial Port Information

Serial Port folder and its contents are shown underneath the Brain folder. The Serial Port folder has data about the Brain's wired connection. This data reads Communication COM167, User COM168.

Serial Port information displays the device path for each port available for a VEX Device. Most VEX Devices enumerate as two serial ports. The Communication serial port is used to download programs and control the brain functions. The User serial port is used to transfer data between the user app running on the Brain and the host computer connected via USB. The V5 Controller is the only VEX device that has just a Communication serial port and no User serial port.

Programs Information

Programs folder and its contents are shown underneath the Brain folder. The Programs folder shows all of the downloaded VEX projects on the Brain. In this example, there are four C/C++ programs downloaded to the connected Brain.

Program information displays a list of all downloaded user programs on a VEX Brain.

Programs folder and its contents are shown underneath the Brain folder, now with the first project's folder opened to show its contents. The project folder shows data about the Slot, File, Type, Size, and Time.

Each program list item can be expanded to show additional information about each user program, such as slot location, filename, language type, filesize, and time of download.

Devices Information

Devices folder and its contents are shown underneath the Brain folder. The Devices folder shows all of the devices that are connected to the Brain. In this example there are 6 devices listed including 4 Motors, a 3 Wire, and an Internal Radio.

Devices information shows a list of all smart port devices connected to a VEX Brain. Each list item shows the smart port number and device type.

Devices folder and its contents are shown underneath the Brain folder. In this example, a Motor device has been selected and its contents reads Type Motor, Version 1.0.0.4, Boot 1.0.2.0.

Each Device list item can be expanded to show firmware version information about each smart port device.

Controller linked status is displayed when connected to VEX Brain Device.

Controller is listed underneath the Devices folder. This Controller reads Controller, linked.

VEX Brain is linked to a VEX Controller

Controller is listed underneath the Devices folder. This Controller reads Controller, not linked.

VEX Brain is not linked to a VEX Controller

Controller is listed underneath the Devices folder. This Controller reads Controller, tethered.

VEX V5 Controller is tethered to a VEX V5 Brain

Screen Shots

Cursor is hovering over the VEX Device Indicator folder and there is a Camera icon shown next to it.

By clicking on the Camera icon, a user can take and download a screenshot from a VEX Brain.
Screen shots are only available when connected directly to a VEX Brain via USB

Battery Medic (V5 Brain Only)

Cursor is hovering over the V5 Brain VEX Device Indicator folder and there is a Battery Medic icon shown next to it.

By clicking on the Heart icon, the extension will download and run the battery medic user program.

Set Brain Name

Cursor is hovering over the Name option inside the System folder and there is a Pencil icon shown next to it.

By clicking on the Pencil icon next to system->name , a user can set the name for a VEX Brain.

Set Brain Name prompt window with a text field and a message below that reads Press Enter to confirm your input or Escape to cancel.

After the Pencil icon is clicked, an input box will appear at the top of the VS Code editor. Type the new brain name in the input box and press enter to set.

Set Team Number

Cursor is hovering over the Team option inside the System folder and there is a Pencil icon shown next to it.

By clicking on the Pencil icon next to system->team , a user can set the team number for a VEX Brain.

Set Team Number prompt window with a text field and a message below that reads Press Enter to confirm your input or Escape to cancel.

After the Pencil icon is clicked then an input box will appear at the top of the VS Code editor. Type the new team number in the input box and press enter to set.

Erase User Program

Cursor is hovering over a program in the Programs folder and there is a Trashcan icon shown next to it.

By clicking on the Trashcan icon next to programs->project name, a user can erase a program in a specific slot. IMPORTANT, once you erase a program it can not be recovered. Please use caution when using this feature.

Device Info Warnings

VEXos Update

Brain folder icon and the VEX Device Indicator icon are shown in orange, and there is a hazard symbol next to the system's VEXos version. These signs indicate that the Brain's VEXos version is out of date.

When a VEX Brain’s VEXos version is out of date, a warning message icon appears next to the VEXos version and both Brain icons turn yellow.

To resolve this warning a user should update VEXos for their VEXos Brain.

Cursor is hovering over the out of date Brain's folder and there is an Up Arrow icon shown next to it.

VEXos can be updated by clicking the up arrow next to the VEX Brain Icon.

Update VEXos prompt window with a message that reads VEXos update available: 1.0.1.0. Source, VEX Extension. Below, there are two buttons that read Update and Ignore.

Also a notification box will appear in the bottom right corner of the VS Code editor when VEXos is out of date. A user can start a VEXos update by clicking the “Update” button or click the “Ignore” button to skip the VEXos update.

Brain not linked to connected Controller

Brain folder underneath the VEX Device Indicator folder has an orange icon and reads Brain, not linked. These signs indicate that there is no VEX Brain connected.

The VEX Controller icon will turn yellow when a VEX Controller is connected to a computer, but is not linked to a VEX Brain.

To resolve this warning a user should link a VEX Controller to a VEX Brain

Terminal Panel

The VEX VS Code Extension provides two terminals on startup, the Log Terminal and the Interactive Terminal

VS Code Terminal window is open and shows the VEX Log Terminal and the VEX Interactive Terminal.

Log Terminal

VS Code VEX Log Terminal is opened and shows the history of the VEX Extension's usage. In this example, there are messages reading Log, Windows build for platform vexexp, Download User Program, Download Finished.

The Log Terminal displays build output, build error, and download results.

Interactive Terminal

VS Code VEX Interactive Terminal is opened and shows a message that reads Hello World.

The Interactive Terminal has two functions, displaying printf logs and sending raw keystrokes back to a user program. In order to take advantage of the Interactive terminal a Brain or Controller must be connected to a computer running the VEX VS Code Extension. Interactive terminal output gets cleared by default after building and downloading a user program.

User Settings

User settings are global settings settings that visual studio code offers for each extension. User settings are applied to every VEX VS Code extension project.

VS Code User Settings is opened to the VEX page where the behavior of the VEX Robotics Extension can be customized.

How to access VEX user settings

Settings icon at the very bottom of the VS Code Activity Bar, located in the bottom left corner of the screen.

Click the gear in the left hand corner of VS Code and a context menu will appear

VS Code Settings context menu with many options listed. An option reading Settings is highlighted and is the third option in the menu, below Command Palette and Profiles.

In the context menu, click the “Settings” item and a settings page will appear.

VS Code Settings Window is open and the Extensions category is highlighted on the left-hand navigation list.

In the left hand list view, click on the “Extensions” item. Next, scroll down to the bottom and find the item labeled “VEX”.

VS Code Settings Window is open and the VEX page link inside the Extensions category is highlighted.

Click on the “VEX” list item.

VS Code User Settings is opened to the VEX page where the behavior of the VEX Robotics Extension can be customized.

The VEX User settings will appear in the right hand panel.

Settings Overview

Controller Channel (V5 Controller only)

The Controller Channel setting controls the radio communication channel type between a V5 Brain and V5 Controller.
This setting only applies when VS Code is connected to a V5 Controller via USB and the controller is connected to a V5 Brain via VEXnet. The user can pick between Download and Pit channels. When set to Download, the radio will jump to a download VEXnet channel once a user program download is initiated. The download channel allows for higher data rates and more efficient downloads. When set to Pit, the radio will remain on a pit channel and the download will take much longer. By default this setting is set to Download.

VEX User Settings with the Controller Channel option shown. This option has a dropdown menu that is set to Download by default. The description reads Sets the V5 Controller Radio Channel.

Cpp Project SDK Home

DO NOT EDIT THIS SETTING.

VEX User Settings with the Cpp SDK Home option shown. This option has a link that reads Edit in settings.json. The description reads DO NOT EDIT.

Cpp Toolchain Path

Cpp Toolchain Path sets the Path for the toolchain that is used when building a C++ VEX VS Code project.

VEX User Settings with the Cpp Toolchain: Path option shown. This option has a text field that represents a File Path.

Enable User Terminal

The Enable User Terminal setting allows the extension to open the user serial port when a VEX Brain or VEX Controller is detected by the extension. The only exception applies to a V5 Controller which does not enumerate with a user serial port.

VEX User Settings with the General Enable User Terminal option shown. This option has a dropdown menu that is set to Enable by default. The description reads Enable extension to open and display data from the user port.

Enable allows the extension to connect to a userport on startup and will create the Interactive Terminal. If enable is selected while the extension is running, the extension will try to open the userport if a device is connected.
Disable prevents the extension from connecting to the user port on startup and won’t create an Interactive Terminal. If disable is selected while the extension is running, the extension will close the user port and remove the Interactive Terminal.

Project Build Type

Project Build Type sets how the extension will build a C++ project. The user can set the build type to Build or Rebuild.
Build only build the project when Make detects any changes in the project’s source code.
Rebuild cleans the project’s build directory, then builds the project. This option is normally much slower.

VEX User Settings with the Project Build Type option shown. This option has a dropdown menu that is set to Build by default. The description reads Set Cpp Project Build Type.

Project Home

Project Home sets the default home directory for a new project when completing the New Project wizard.

VEX User Settings with the Project Home option shown. This option has a text field that represents a File Path. The description reads Sets the default location for new projects.

Run After Download

Run After Download when enabled, causes the user program to run after it is downloaded to a VEX Brain.

VEX User Settings with the Project Run After Download option shown. This option has a check box that is shown as selected in this example. The description reads Set if user program should run after download.

Python SDK Home

DO NOT EDIT THIS SETTING.

VEX User Settings with the Python SDK Home option shown. This option has a link that reads Edit in settings.json. The description reads DO NOT EDIT.

VEX Command Help

VEX Command Help allows access to documentation for specific functions included in the C++ and Python API (Application Programming Interface). Documentation is specific to each VEX Platform(IQ 2nd Generation, EXP, V5).

C++ command in the VS Code editor has been highlighted with the cursor.

To access VEX Command Help, first highlight the text of the function to search for.

Context menu for the C++ command has been opened and the VEX Command Help option is highlighted.

Right Click on the selected text, and a context menu will appear.
Next Click on the VEX Command Help to access documentation.

VEX Command Help page is open, and it shows information about and examples of the Brain Screen Print C++ command.

If VEX Command Help finds an exact match, a new webview will appear with relevant documentation.

VS Code search bar with a Quick Pick List of matching VEX C++ commands in VEX Command Help to help narrow down the user's search.

If multiple documents match the selected text, then a drop down will appear with a filtered list of relevant documentation.

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

Last Updated: