Get logical value of digital input pin
Simulink Support Package for Arduino® Hardware/Common
Get the logical value of a digital pin on the Arduino hardware:
If the logical value of the digital pin is LOW (0
V), the block output emits
If the logical value of the digital pin is HIGH (5
V, depending on the board voltage), the block output emits
The data type of the block output is boolean.
During simulations without the hardware, this block emits zeroes.
- Pin number
Enter the number of the digital pin.
Do not assign the same pin number for different types of blocks as this may cause resource management conflicts.
Click View pin map to open the Arduino Pin Mapping table.
To know how to assign pins or to know about the fixed pins for the block, see Pin Mapping for Arduino Timer Independent Blocks.
- Sample time
Specify how often this block reads the pin value, in seconds. Enter a value greater than zero. This value defaults to a sample time of
Smaller values require the processor to complete the same number of instructions in less time, which can cause task overruns.