Main Content

Button

Read logical state of button

  • Button block

Libraries:
Simulink Coder Support Package for BeagleBone Blue Hardware / Basic

Description

The Button block reads the logical state of a user-configurable button on the hardware. The hardware has two user-configurable buttons, Mode and Pause, with two logical states, pressed and released.

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

Ports

Output

expand all

When the button specified in the Button parameter is pressed on the hardware, the block outputs 1. When the button specified in the Button parameter is released on the hardware, the block outputs 0. For example, if the Button parameter on the Block Parameters dialog box is set to Mode, and the Mode button on the hardware is pressed, the block outputs 1. When the Mode button is released, the block outputs 0.

Data Types: uint8

Parameters

expand all

Select the button of which the logical state (pressed or released) is to be read.

Specify how often the block reads the state of the button specified in the Button parameter.

Version History

Introduced in R2017b