digitalRead()
Description
Reads the value from a specified digital pin, either HIGH or LOW.
Syntax
digitalRead(pin)
Parameters
pin
: the number of the digital pin you want to read (int)
Returns
Example
Sets pin 13 to the same value as pin 7, declared as an input.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Note
If the pin isn't connected to anything, digitalRead()
can return either HIGH or LOW (and this can change randomly).
Unlike Arduino, the analog input pins (referred to as A0, A1, etc) of 86Duino cannot be used as digital pins.
See also
- pinMode()
- digitalWrite()
The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.