What I want to know is that how exactly does analogRead work because I have want to use it with a flex sensor and it has only two pins.I tried to find other examples on the internet, but this is the only example I find.If the middle pin of the 10k potentiometer and a0 pin are shorted or the gnd pin is removed altogether,then would this thing work?
1 Answer
I think you are confused because the ADC input measures voltage, not resistance.
To convert from resistance to voltage you need to pull in the opposite direction on the variable resistance with a fixed resistor. As in the following image from this tutorial.