When starting to program with VEXcode V5, blocks for the GPS Sensor will not appear in the Toolbox until it has been configured.
Adding the GPS Sensor as a Device in VEXcode V5
With VEXcode V5, configuring the GPS Sensor is accomplished by using the ‘Add a device’ feature. To provide an example of this, the following steps will add the GPS Sensor as a device within VEXcode V5.
Select the Devices icon.
Select ‘Add a device.’
Select the Smart Port that the GPS Sensor is plugged into on the V5 Robot Brain.
There is an option to change the X, Y and Angle offsets, adjust the offsets depending on the design of your robot.
For more information about how to determine your robot's offset, view this article from the VEX Library.
Once the port is chosen and the offsets have been adjusted, select ‘DONE'.
Once the GPS sensor has been added to your user program, a new set of sensor commands will become available.
For more information on the commands from the ‘Sensing’ category pertaining to the GPS Sensor, view the Help information (Blocks project or Python project).
Changing a GPS Sensor's Port Number
You can change the port number for the device by selecting it in the Devices window.
Select the port icon in the top right, then select a different port on the Port Selection screen and the port number will turn green. Then select ‘Done’ to submit the change.
If you change the port of a device that is already being used in your project, you will need to update the device's name in the block to the new name using the drop down.
Renaming a GPS Sensor
You can rename the device by changing the name in the text box at the top of the Port Selection screen. 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.
Note: for more information about naming rules for variables and devices, view this article from the VEX Library.
If you change the name of a device that is already being used in your project, you will need to update the device's name in the block to the new name using the drop down.
Deleting a GPS Sensor
The device can be deleted by selecting the ‘Delete’ option at the bottom of the Offset screen.
Note: If you delete a 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 blocks that were using the deleted device.