Maximum ADC value

When I wire up a potentiometer to an ADC and 3V3_A/GND, then code up using AnalogControl, the values I read range from 0 to 0.9999. Is this normal, or should they go up to 1?

It seems normal to me, If by “normal” you mean do I get similar results.

I think the behavior reflects the ‘real world’. If it is ‘bad’ from the viewpoint of your code you could convert sufficiently small values to zero and sufficiently large values to one in the read of the pot.

You could also look at the code to see how the ADC value is converted to float and scaled 0-1.

Yes, I can definitely handle it in code, I was just making sure I should - Obviously if I have an error somewhere I should fix that, not work around it. But if everyone else gets the same results then I’ll go with that.

My suggestion wasn’t to fix it in code, but to understand if it was behaving as expected.

That was my intention too, and I think it is.

1 Like