Extension components
In this section we will talk about some components that extend the functionalities of our developer kits, allowing us to do more and overcoming some of the deficits with Arduino, such as the lack of analog inputs and the very limited amount of PWM pins.
Analog to digital converter (ADC) – PCF8591
There are many sensors that just provide an analog value: moisture, smoke, raindrop, light, temperature, and so on, and as we mentioned several times, the Android Things developer kits do not have any analog inputs. To be able to use these sensors as input, we need a special component called an Analog to Digital Converter (ADC).
An ADC reads an analog value and converts it to a digital value. The resolution depends on the chip; most chips offer 8 or 10 bits.
There is a driver for an ADC in the contrib-drivers
library, but the component itself has been retired, so we will be using a different one: PCF8591.
Note
The ADC included in the contrib-drivers
set is no longer available
This...