Up to this point, we have only been working with digital input to our board. In the button example covered in Chapter 2, Input and Output, the external hardware input only gave us the state of the button, a high or a low state. In this chapter, we will talk about analog input; we will measure the voltage on a pin and observe its change over time. For this purpose, our board has several pins that are connected to ADC. ADC converts analog voltage to a digital value, instead of just indicating a high or a low state.
Environmental sensors, such as temperature or light sensors, change their output voltages depending on the surrounding conditions. This way, for example, a temperature of 25 degrees will result in a different output voltage than 15 degrees. For our home automation server, there are a couple of interesting sensors.