Thanks Bob, This is actually what I have now however it reduces the resolution of my=20 system from 1024 values to 1024/(deadband+1) . I was hoping to avoid=20 the drop in resolution. I am building a light dimmer so I want as=20 gradual a curve as possible when I am moving the POT to control the output. Jim > #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 >> really a filtering issue because for example if my POT is set close or >> on the edge of an A/D transition I believe I will still see a bit >> flipping occasionally in the LSB if I have lots of filtering. Not sure >> if I am being clear but I really only want to have the reading change my >> output if I am moving the POT so thought there would be a clever way to >> detect that and only update my output if the input is varying >> substantially. Perhaps to really get the best results I need a >> multiturn POT or move to a digital encoder. >> Thanks, >> Jim --=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 .