Link Search Menu Expand Document

Digital Input

“Digital” refers to the binary values of 1 or 0. A digital signal represents an on or off state.

Table of contents

  1. Applications
  2. Digital signals and values
  3. Setting the pinMode
    1. Reading a digital input

Applications

Digital Input is used in the following applications.

  • Reading digital inputs such as buttons

Digital signals and values

Setting the pinMode

Digital pins on an Arduino can be configured for input or output. When a digital pin is used for input, the result is a value of HIGH or LOW depending on the voltage level of that pin relative to the logic level used by the microcontroller.

pinMode(10, INPUT);

Adafruit Feather boards use 3.3V logic. Therefore the maximum allowable voltage (relative to board GND) is 3.3V

An input value is considered HIGH when the voltage on the digital pin (relative to ground) is close to 3.3V. An input value is considered LOW when the voltage on the digital pin is close to zero.

Reading a digital input

int pinState;
pinState = digtialRead(10)