Using Blocks for Controller Buttons / Joysticks in VEXcode V5

VEXcode V5 can access all of the data from the V5 Controller by referencing the buttons and axes by their described names. 


Position and Names of Buttons and Joysticks

View the following image describing the position of the Buttons and Joysticks as well as their proper names:

Two diagrams of the V5 Controller with its buttons and joysticks labeled. Above is a view from the front of the controller, with the left joystick's axis labeled as 3 and 4. The four arrow buttons below the left joystick are labeled ButtonUp, ButtonRight, ButtonDown, and ButtonLeft. The right joystick's axis are labeled as 1 and 2. The four round buttons below the right joystick are labeled ButtonA, ButtonB, ButtonY, and ButtonX. Below is a view of the top of the controller to show the shoulder buttons. The two buttons on the left side of the controller are labeled L1 and L2, and the two buttons on the right side of the controller are labeled R1 and R2.

Buttons return values of:

  • 1 - Pressed
  • 0 - Not Pressed / Released

The Joystick Axis return values of -100 to +100 when centered at zero.


Blocks that include Controller Buttons and Joysticks

When programming in VEXcode V5, understanding the Button and Joystick names as well as their position on the Controller helps determine which block should be used. The Controller will first need to be configured before blocks including the Controller will be visible. Click here for more information about blocks:

VEXcode V5 blocks project that spins an Arm Motor up while the Controller's L1 button is pressed. The project reads When Controller1 button L1 pressed spin ArmMotor up, wait until not Controller1 L1 pressed, and then stop ArmMotor.

Additional Controller Articles

For more information about using the Controller, view the following articles:

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

Last Updated: