I am trying to use a potentiometer to move a stepper back and forth.
However, looking at my ADC values in debug, it fluctuates by plus and minus 1 value on certain parts of the pot. As I am trying to compare the value of b1 against a previously filled in variable b2, and use it to tell me if the pot was turned up or down. But because of the fluctuations its obviously causing problems.
So I was trying to register a change only if the ADC value had changed by 3 units in either direction, and thats where I cannot seem to get it right.
How can register the change if the change from last time is more than a value of 2 or 3, so the ADC fluctuation is ignored unless it's a bigger value change
Hope I am not confusing everybody.
However, looking at my ADC values in debug, it fluctuates by plus and minus 1 value on certain parts of the pot. As I am trying to compare the value of b1 against a previously filled in variable b2, and use it to tell me if the pot was turned up or down. But because of the fluctuations its obviously causing problems.
So I was trying to register a change only if the ADC value had changed by 3 units in either direction, and thats where I cannot seem to get it right.
How can register the change if the change from last time is more than a value of 2 or 3, so the ADC fluctuation is ignored unless it's a bigger value change
Hope I am not confusing everybody.