Using the Blocks Competition Template in VEXcode V5

The Competition Template is an example project that has blocks already included to communicate with the Field Control System during competitions, ensures blocks are in compliance with field regulations, and aids in setting up projects in order to avoid complications and disqualification ("competition" refers to a VRC event using the official field control hardware).  


Open the Competition Template from the Examples Page

VEXcode V5 Toolbar with the File menu open and the Open Examples option highlighted. Open Examples is the fourth option in the menu, below New, Open, and Open Recent.


 

Example Projects menu in the Templates category with the Competition Template example project highlighted.

Three sections of the template: Pre-autonomous, Autonomous Mode, and Driver Control

VEXcode V5 blocks workspace with the Competition Template project opened. There are three individual hat blocks in the workspace, and they read When started, When autonomous, and When driver control.

Note: In order for your project to work at a competition, you must leave these hat blocks in your project. The hat blocks can be moved around, but must stay somewhere in the project. Create stacks from these hat blocks.


Use the When Started Block for any Pre-autonomous Setup

VEXcode V5 blocks stack that reads When started, calibrate GyroA.

The “When Started” hat block is used for any set-up your robot may need such as calibrating a gyro, setting variables, or other device settings. These blocks will run immediately when the project is started, before the autonomous portion of the match begins.

Note: If no setup is needed, the “When Started” stack can remain empty.


When Autonomous

VEXcode V5 blocks stack that reads When autonomous, drive forward for 20 mm, turn right for 90 degrees, set drive velocity to 60%, and then drive forward for 30 mm.

The “When Autonomous” hat block is used for controlling your robot during the autonomous portion of a VRC match. Blocks attached to this stack will run when the match begins the Autonomous period.

Note: If no Autonomous routine is desired, the “When Autonomous” stack can remain empty.


When Driver Control 

VEXcode V5 blocks stack that reads When driver control, forever. The forever C block is empty in this example.

The “When Driver Control” hat block is used for controlling your robot during the driver control portion of a VRC match.  Blocks attached to this stack will run when the match begins the Driver Control period.

Note: The “forever” loop is shown above as most users will place conditional C-Blocks in this stack to respond to input from the V5 Controller.

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

Last Updated: