1. Digital Input/Output

In a sense, all these LEDs we have used so far acted as digital outputs. What else can be a digital output? Any device that can have two states: ON and OFF, HIGH and LOW, 5V and 0V. 

So far we have not used any external signal with the Arduino as input to one of the pins. There are million of ways to trigger an electronic system, the most common being the switch.

When the switch is ON, it allows electricity flow in a circuit, and when it is OFF it does not. In Arduino, this translates to HIGH and LOW accordingly.

There are many types of switches around us. We will first experiment with buttons. The main input device of personal computers, the keyboard, is actually a set of switch buttons.