0

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?

2
  • You did not show us the example which is confusing you. – st2000 May 24 '17 at 7:03
  • I moved this to the answer... – st2000 May 24 '17 at 7:06
3

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.

enter image description here

1
  • Hmmm...the image said it all....thank you... – nalostta May 24 '17 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.