This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Gamepad Button

Represent one of the 12 buttons on VEX V5 Controller gamepad and read the logical value of the button

  • Library:
  • Simulink Coder Support Package for VEX EDR V5 Robot Brain / Gamepad


The Gamepad Button block is used to represent one of the 12 buttons on the VEX® V5 Controller gamepad, and read the corresponding logical value (1 or 0) based on whether the button is pressed or released.



expand all

When you press the button, the block output is 1; otherwise (in a released state of the button), the block output is 0.

Data Types: Boolean


expand all

You can have a pair of VEX V5 Controller gamepads to control the peripherals connected to VEX EDR V5 Robot Brain.

Before you make the selection, review the labelling of the buttons on the VEX V5 Controller gamepad.

Specify how often the Gamepad Button block should read the logical value of the button.

When you set this parameter to -1, Simulink® determines the best sample time for the block based on the block context within the model.

Introduced in R2018b