Read logical state of selected push button on LCD Display Module
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 (Simulink). 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.
Port_1— State of the selected button for simulation purpose
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.
Port_1— State of the selected button:
1while pressed and
The block outputs the state of the selected button on the LCD
1 while pressed and
UART port— UART port number
Select the UART port number on the microcontroller to which the LCD Display Module is connected.
Button— Button to read the logical state
Select the button whose logical state (pressed or released) is to be read.
Add input port for simulation— Specify if you want to run a normal mode simulation
If you want the normal mode simulation with a source block providing the input value, select this parameter.
Sample time— Specify how often to read the state of a button
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).