HIGH or a
LOW value to a digital pin.
If the pin has been configured as an
pinMode(), its voltage will be set to the corresponding value: 5V (or 3.3V on 3.3V boards) for
HIGH, 0V (ground) for
If the pin is configured as an
digitalWrite() will enable (
HIGH) or disable (
LOW) the internal pullup on the input pin. It is recommended to set the
INPUT_PULLUP to enable the internal pull-up resistor. See the Digital Pins tutorial for more information.
If you do not set the
OUTPUT, and connect an LED to a pin, when calling
digitalWrite(HIGH), the LED may appear dim. Without explicitly setting
digitalWrite() will have enabled the internal pull-up resistor, which acts like a large current-limiting resistor.
pin: the Arduino pin number.