Main Content

LCD Button

Read logical state of selected push button on LCD Display Module

  • LCD Button block

Simulink Coder Support Package for ARM Cortex-based VEX Microcontroller/LCD


The LCD Button block reads the logical state of the selected push button on the LCD Display Module. To select a push button, use the Button parameter.

The block output is 1 while the button is pressed. The block output is 0 while the button is released.

There are three buttons on the LCD Display Module: Left, Center, and Right. To control the peripherals, such as a servo motor that is connected to the VEX microcontroller, use the values from these buttons.

During simulations, without the hardware, this block emits zeroes if there is no source block connected to the simulation input port. See Block Produces Zeros or Does Nothing in Simulation. To achieve simulation, connect a source block from the Utilities library in VEX microcontroller library.

During code generation, any simulation block that is connected to the input port of the LCD Button block is ignored and has no effect on the generated code.



expand all

When you select the Add input port for simulation parameter, an input port becomes available.

For simulation behavior, provide the state of the button from this port via a source block.

Any nonzero value at this port indicates that the button is pressed. A value of 0 at this port indicates that the button is released.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean


expand all

The block outputs the state of the selected button on the LCD Display Module: 1 while pressed and 0 while released.

Data Types: double


expand all

Select the UART port number on the microcontroller to which the LCD Display Module is connected.

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

If you want the normal mode simulation with a source block providing the input value, select this parameter.

Specify how often the block reads the state of the button, in seconds.


If you select the Add input port for simulation parameter, the Sample time parameter is hidden and the value is inherited (Sample time = -1).

Version History

Introduced in R2017a