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
0
.
If the logical value of the digital pin is HIGH (5
V
or 3.3 V
, depending on the
board voltage), the block output emits 1
.
The data type of the block output is boolean.
During simulations without the hardware, this block emits zeroes.
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.
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 0.1
second. The minimum value is
0.000001
second.
Smaller values require the processor to complete the same number of instructions in less time, which can cause task overruns.