On Fri, 13 Feb 2009, glerm soares wrote:
My doubt is: how to get a *totally* not flickering analog input with more than 64 steps?
Even if you have only two steps, if the value is exactly on the limit, even the tiniest noise will make the input flip from 0 to 1 and back, endlessly.
The solution is then to use some kind of modified [change] that uses a confidence interval.
So when you output an y, you also need to set a pair of [moses] so that it can find numbers outside of the interval y-c < x < y+c, or equivalently, abs(x-y) < c, where c is the minimum amount of change that you want to hear about.
If you are in a two-dimensional system, it's better to consider pairs of inputs together as being one thing, and so for inputs (x,y) and outputs (u,v), check for hypot(x-u,y-v) < c, or equivalently, (x-u)*(x-u) + (y-v)*(y-v) < c*c; that way, your system will be independent of the angle of change.
[change] itself can be replaced by a very small abstraction, and those two modified versions that I suggest, are not much bigger than that.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec