top of page

07 Working with I/O Pins

digitalRead()

Input/Output and Analog/Digital I/O Comparison

Pins in the Arduino controller can be configured as inputs or outputs. Additionally they can be either an analog or digital signal. The following table summarizes this variation and the commands used for each.


Reads the value from a specified digital pin, either HIGH or LOW.


Note: If the pin isn't connected to anything, digitalRead() can return either HIGH or LOW (and this can change randomly).


digitalRead(pin)


pin: the number of the digital pin you want to read (int)


Returns

HIGH or LOW




© 2021 Odyssey Navigator. All rights reserved.

bottom of page