I'm using Arduino UNO to programming a volume control reading from a potentiometer.
Basically I reading the voltage from a potentiometer connected directly in A/D of Arduino.
So 5V is 1023 -> Max. volume -> 100k ohms
0V is 0 -> Min. Volume -> 0 ohms
I convert the value to resistance and I will show the value in the 7 segments display. So:
Reading 1000 -> show 01 - represent 1% of volume
reading 2000 -> show 02 - represent 2% of volume
reading 100000 - > show 99 - represent 100% of volume
When the user rotate the potentiometer, the display change according.
I take the A/D reading and plot direct to 7 segments display.
The big problem is a histerese between the next value. For exemplo.
The 7 segments change fast between 7 and 8. I need solve this problem to fix 8 in this case, no change. Because I don't want this effect to the user.
I try make average of value, but the problem continue... return average for 8 and 7... variation continue.
How can I solve this problem, to read A/D and always show the value in display without histerese?
Please, I need some suggested in this case.