#define DEADBAND 1 if ((oldval + DEADBAND) > newval) updateVal(newval); if ((oldval - DEADBAND) < newval) updateVal(newval; Don't worry about rollover/under, as long as all values are unsigned. Still dithering? Increase DEADBAND to 2. Cheers, Bob On Thu, Nov 26, 2015, at 08:28 PM, Jim Ruxton wrote: > Thanks everyone for the suggestions. I don't think in my case it is=20 > really a filtering issue because for example if my POT is set close or=20 > on the edge of an A/D transition I believe I will still see a bit=20 > flipping occasionally in the LSB if I have lots of filtering. Not sure=20 > if I am being clear but I really only want to have the reading change my= =20 > output if I am moving the POT so thought there would be a clever way to=20 > detect that and only update my output if the input is varying=20 > substantially. Perhaps to really get the best results I need a=20 > multiturn POT or move to a digital encoder. > Thanks, > Jim --=20 http://www.fastmail.com - Same, same, but different... --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .