Display button widget on device screen
Simulink Support Package for Android Devices / User Interface
The Button block displays a button widget on the Android™ app. The button has two states: pressed and not-pressed. Tapping the button switches the state of the button. The Button state parameter determines the button state when the Android app starts.
During simulation with no hardware connected, this block does nothing. For more information, see Block Produces Zeros or Does Nothing in Simulation.
Port_1 — Button state output
The block outputs the button state, returned as a Boolean scalar. If the button
Pressed, the block outputs
If the button state is
Not Pressed, the block outputs
Button state — Initial state of button
Not pressed (default) |
Select the initial state of the button when the Android app starts.
Sample time — Time interval of sampling
0.1 (default) | nonnegative scalar
Specify a discrete time interval, in seconds, at which the block reads the button state and outputs the data.
Smaller values for Sample time require the processor to complete the same number of instructions in less time, which can cause task overruns.
Introduced in R2015a