For this lab, we learned how to use an analog input with the Arduino to go precise, granular readings on inputs rather than the simple 0 or 1 of digital. We start by building a circuit with variable analog resistors. I used a pair of force-sensing resistors, which read how much pressure is being applied to them. Here’s the assembled board:
Once the circuit was assembled and powered, I could apply pressure to one of the sensors and the red LED would light up according to how hard I pressed. Very cool:
I went through some of the sketches in the lab, one of which allowed me to print a numerical reading of my analog sensor to the console, like so:
The numbers are totally granular, and respond smoothly to how hard I squeeze the sensor. This could have endless applications, as this number could be translated to control absolutely anything based on any analog sensor reading.
Yea for analog input.