Would it be possible/correct to provide a mechanism to allow a pot object to be defined with a "jitter" band. As it is, pots seem to generate a LOT of clutter on the output stream.
i.e. Add an optional parameter to the constructor for a "jitter band" value
In the PollingInput method, test the new value against the previous value and ONLY if it falls outside the jitter band
i.e. ( value < ( lastState - jitter )) || ( value > ( lastState + jitter ))
/* need to test for under/overflow when applying +/- jitter */
If true, send the update message, and set the new "lastState".
In the current code, you always set the value of lastState even if it was the same as the previous read?
Would it be possible/correct to provide a mechanism to allow a pot object to be defined with a "jitter" band. As it is, pots seem to generate a LOT of clutter on the output stream.
i.e. Add an optional parameter to the constructor for a "jitter band" value In the PollingInput method, test the new value against the previous value and ONLY if it falls outside the jitter band i.e. ( value < ( lastState - jitter )) || ( value > ( lastState + jitter )) /* need to test for under/overflow when applying +/- jitter */
If true, send the update message, and set the new "lastState". In the current code, you always set the value of lastState even if it was the same as the previous read?