mrkva:
Hello,I am trying to scale my analog readings and I get into a problem of 'unstable' values.
My goal is to scale 0-1023 to 50-250. I am using the map function – map(A0, 0, 1023, 50, 250). I have set up a display to check the values.The problem is that sometimes I run into 'middle' values, where the display is flickering between two – for example 69 and 70.
How would you approach this topic? Some DSP low-pass filtering?Thanks for any help!
Usual first method is to try to take multipule samples and divide by the number of samples taken, thus getting a average value. That acts like a first order low pass filter. Start with maybe 8 samples, divide by 8 then perform your map function. If that settles down the value you can then try with just 4 samples, etc.
Lefty