Digital versus analog input

Much like with digital and PWM output, there are two types of input devices: digital and analog. Digital inputs are either on or off: buttons are a prime example of this. Analog inputs give a different level of voltage of signal depending on what they are sensing; a photoresistor, for example, puts out higher voltage signals when the ambient light is high, and lower when it is darker. 

In order to read data from analog devices, you'll need a pin that can accept an analog input. But as we saw in the last chapter, all of the GPIO pins on the Raspberry Pi are digital. Luckily, there are ways to get around this limitation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.2.122