Configuring the V5 Vision Sensor in VEXcode Pro V5

The VEX Visual Studio Code Extension has replaced VEXcode Pro V5, which is now end-of-life.

VEXcode Blocks and VEXcode Text remain actively developed and supported for all VEX platforms.

When starting to program with VEXcode Pro V5, Vision Sensor commands will not appear in the Command Reference until the Vision Sensor has been configured. 


Adding the Vision Sensor

VEXcode Pro V5 interface with Robot Configuration button highlighted on the Toolbar.

To configure the Vision Sensor, select the Robot Configuration button to open the Robot Configuration window. A project must be open in order to use the Robot Configuration window.

Robot Configuration menu with the ‘Add a device’ option shown.

Select “Add a device.”

Device selection window with the Vision Sensor option highlighted.

Select the Vision Sensor.

Port selection window showing Vision Sensor assigned to a port on the V5 Brain.

Select which port the Vision Sensor is attached to on the VEX V5 Brain. Ports that are already configured for other devices will be unavailable.

  • Once the port has been selected, you will see the Vision Sensor's Configure window. To Configure, follow the next set of steps. 

Click here for help in mounting and wiring your Vision Sensor.


Configuring the Vision Sensor

Vision Sensor settings window showing Vision12 device with Configure button and Done button displayed.

Connect the Vision Sensor directly to your computer using a Micro USB Cable before you select Configure on the Robot Configuration window.

VEX Vision Sensor connected to a computer using a Micro USB cable.

You can use the same Micro USB that you use to connect the Brain to the computer.

Note: The Brain does not need to be connected to the computer or turned on for this process.

Vision Sensor settings menu with the Configure button highlighted.

Once connected, select the Configure button for the Vision Sensor in VEXcode Pro V5.

Vision Utility showing camera view with the Freeze button highlighted.

Place an object in front of the Vision Sensor, then select the Freeze button.

Vision Sensor settings with Set button highlighted to save a newly selected color signature.

Select the image on the screen and drag a bounding box around it. Then choose one of the seven signature slots.

  • Be sure to select as little of the background as possible. 
  • In this example, I'm choosing the SIG_1 Slot.

Vision utility showing color detection alongside signature slider being adjusted to improve recognition.

Click to calibrate the color signature.

  • Move the slider until most of the colored object is highlighted and the background and other objects are not highlighted.

 

Vision utility showing a signature of a green cube being renamed to G_CUBE.

Name and save the signature by selecting its label and typing in a name. Here, SIG_1 is being saved as G_CUBE.

Vision Sensor settings with Clear button highlighted to remove an existing color signature.

If you want to delete one of the saved signatures, select the Clear button in that signature's row.

  • You can also select the Clear All button to delete all saved signatures.

Vision Sensor settings menu with the Done button highlighted below.

Close to exit the Vision Utility window after you have saved all of the signatures you want to include. Then select the Done button.

C++ Code screenshot with a dropdown menu of all configured Signatures that can be detected.

Now your saved signatures will now appear in the Signature options of Vision Sensor commands.

Changing the Vision Sensor’s Port Number

Robot Configuration menu with the Vision Sensor device shown.

You can change the port number for the Vision Sensor by selecting the Vision Sensor in the Robot Configuration window.

Vision Sensor settings menu with its port icon highlighted to show that it can be changed.

Then click on the current port number at the top right side of the Robot Configuration window.

Vision Sensor settings in the port menu with the port changed and the Done button highlighted below.

Select a different port on the Port Selection window and the port number will turn blue. Then select Done to submit the change.


Renaming the Vision Sensor

Vision Sensor settings menu with the name field highlighted.

You can also rename the Vision Sensor by changing the name in the text box at the top of the Robot Configuration window. If you select an invalid name, the text box will highlight red to indicate. Then select Done to submit the device changes to the configuration.

C++ Code screenshot with a prompt to change all instances of the name Vision12 to Vision.

If you already have Vision Sensor commands in your project, you will need to update the Vision Sensor's name in the command to the new name.


Deleting the Vision Sensor

Vision Sensor settings menu with the Delete button highlighted below.

The Vision Sensor can also be deleted by selecting the “Delete” option at the bottom of the Robot Configuration window.

Note: If you delete the Vision Sensor and it is already being used in your project, your project will not work until you also delete the commands that were using the Vision Sensor.

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

Last Updated: