Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Thanks, as this doesn't solve the problem I won't mark is as an answer but it is valuable input anyway. The code comes from the sample, I'll improve it and redo the calculation, indeed seems to make more sense. Commented Nov 10, 2015 at 10:55
  • One other thing. Are you sure the connections are correct? Your results look a lot like when you are measuring a voltage divider at the wrong resistor. So try inverting your measurements, so: measuredValue = 1024 - analogWrite(pin); Commented Nov 10, 2015 at 12:26
  • Thank you, used the hint about inverting the measurements. Improved the reading but didn't solve the issue. Commented Nov 11, 2015 at 19:53