Main Content

Button

Detect status of EV3 brick button

Add-On Required: This feature requires the Simulink Support Package for LEGO MINDSTORMS EV3 Hardware add-on.

  • Lego EV3 Button block

Libraries:
Simulink Support Package for LEGO MINDSTORMS EV3 Hardware

Description

Use the Button block to detect whether the LEGO® MINDSTORMS® EV3 brick button is pressed or not. You can configure the block to detect the status of center, left, right, up, and down buttons. However, you cannot configure the block to detect the status of the back button as the EV3 brick reserves it to stop and shut down programs.

During simulations without hardware, this block emits zeros. See Block Produces Zeros or Does Nothing in Simulation.

Ports

Output

expand all

The block outputs the status of the LEGO MINDSTORMS EV3 brick button.

  • 0 — Indicates that the EV3 brick button is not pressed.

  • 1 — Indicates that the EV3 brick button is pressed.

Data Types: uint8

Parameters

expand all

Select the LEGO MINDSTORMS EV3 brick button of whose status is to be determined.

Specify the frequency of how often the block reads the EV3 brick button status. Shorter sample times, such as 0.01, may produce unreliable measurements.

Smaller sample times require the processor to complete the same number of instructions in less time, which can cause task overruns.

Version History

Introduced in R2012a