Brick Buttons Block

The Brick Buttons block gets data from the Brick Buttons, which are the five buttons (Left, Centre, Right, Up, and Down) on the face of the EV3 Brick. You can find out which button is pressed and get a Numeric output. You can also test one or more buttons to check if one is Pressed, Released, or Bumped, and get a Logic (True or False) output.

See Using the Brick Buttons for more information about the data provided by the Brick Buttons, and programming examples.
Choose the Mode


Mode Selector
Inputs
Outputs

Use the Mode Selector to select the mode for the block. The Inputs and Outputs available will change depending on the mode. The modes are described below.
Modes
Measure


The Measure mode outputs the ID of the button that is currently pressed to Button ID.
Compare


In the Compare mode, you can choose which state of a button to test (Released, Pressed, or Bumped) in the Action input. You can also test a set of buttons to see if any of them matches the specified state.

In the Set of Brick Button IDs, select the button or the set of buttons you want to test. The Compare Result will be True if any of the selected buttons matches the specified Action. The ID of the button, which matches the specified action, will be output in Button ID.
Inputs and Outputs
The inputs available for the Brick Buttons block will depend on the mode selected. You can enter the input values directly into the block. Alternatively, the input values can be supplied by Data Wires from the outputs of other Programming Blocks.
InputTypeAllowed ValuesNotes
Set of Brick Buttons IDs Numeric Array(Each element) 0 – 5(Each element):
0 = None
1 = Left
2 = Centre
3 = Right
4 = Up
5 = Down
Action Numeric0 - 2Button state to test for:
0 = Released
1 = Pressed
2 = Bumped
The outputs available will depend on the mode selected. To use an output, use a Data Wire to connect it to another Programming Block.
OutputTypeNotes
Button ID NumericThe pressed button:
0 = None
1 = Left
2 = Centre
3 = Right
4 = Up
5 = Down
Compare Result LogicTrue/False result of the Compare mode.
Brick Buttons
Quick links