Configuring 3-Wire Devices 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, Sensor and 3-Wire device commands will not appear in the Command Reference until they have been configured.


Adding a 3-Wire Device

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

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

VEXcode Pro V5 Robot Configuration menu is open and the ‘Add a device’ option is shown.

Select “Add a device."

Device selection window with the 3-Wire option highlighted.

Select the 3-wire Devices.

Device selection screen showing multiple 3-wire devices and with the Limit Switch selected.

Select the 3-wire Device that you are using. This example shows a Limit Switch.

Note: 3-wire Devices include the Limit Switch, Bumper Switch, Encoder, Range Finder, Line Tracker, Light, Potentiometer, LED, Gyro,  Motor-393, Servo, Accelerometer-2G, and Accelerometer-6G. All devices follow the same configuration process with an additional step for Motor-393. See the bottom of this article for more details. 

Port selection screen with the Limit Switch device assigned to port E and the Done button highlighted.

Select which port the device 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, select “Done” to submit the device to the configuration or “Cancel” to return back to the Robot Configuration window.

Note: Selecting “Cancel” will undo any changes you have made to the device and will not be a part of the configuration.


Changing a 3-Wire Device’s Port

Robot Configuration window showing the Limit Switch device to change its port.

You can change the port number for the 3-Wire Device by selecting the 3-Wire Device in the Robot Configuration window.

Port selection screen with the Limit Switch device assigned to port D and the Done button highlighted.

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


Renaming a 3-Wire Device

Side by side screenshots to demonstrate changing the device's name using the name field. The new name reads LeftLimitSwitch.

You can also rename the 3-Wire Device by changing the name in the text box at the top of the Port Selection window. If you select an invalid name, the text box will highlight orange to indicate. Then select "Done" to submit the device changes to the configuration.

C++ code example showing device name updated in program after renaming a 3-wire device. The new name reads LeftLimitSwitch and this is reflected in the code.

If you change the name of 3-Wire Device that is already being used in your project, you will need to update the device's name in the command to the new name.


Deleting a 3-Wire Device

Port selection window with Delete button highlighted to remove a 3-wire device.

3-Wire Devices can also be deleted by selecting the “Delete” option at the bottom of the Port Selection window.

Note: If you delete a 3-Wire Device that is already being used in your project, your project will generate an error if you try to download it until you also delete the commands that were using the deleted device.


Configuring a VEX Motor-393

Device selection screen with VEX Motor-393 option highlighted.

Select the VEX Motor-393 from the list of devices.

Port selection screen showing Motor-393 assigned to a port with Done button highlighted.

Select a port for the Motor-393.

Motor settings window for Motor-393 showing options to change name, port, and direction.

After selecting the port, this Motor Settings window will let you configure Motor-393 further by:

  • Changing the name
  • Changing the port
  • Changing the direction

For more information on these additional configurations, see the options below.

Motor settings window with Motor-393 name field highlighted for editing.

Changing the name of Motor-393.

Motor settings window with port selection icon highlighted to change Motor-393 port.

Changing the port of Motor-393.

Motor settings window showing toggle to switch Motor-393 direction between normal and reverse.

Changing the direction of Motor-393.

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

Last Updated: