Digital I/O

This GR-COTTON sketch reference library is used to input/output a digital signal (0 or 1).

pinMode

Description

Configures the specified pin to behave either as an input or an output.

Syntax

pinMode(pin, mode)

Parameters

pin: The number of the pin whose mode you wish to set
mode: INPUT, OUTPUT or INPUT_PULLUP

Returns

None

Remark

Analog pins A0 to A5 (14 to 21) have no internal pull-up registers. Do not specify INPUT_PULLUP for these pins.

digitalWrite

Description

Write a HIGH or a LOW value to a digital pin. If the pin is configured as an INPUT, writing a HIGH value with digitalWrite() will enable an internal pullup resistor. Writing LOW will disable the pullup