Go Down

Topic: HELP: tri axis Accelerometer smoothing (Read 1 time) previous topic - next topic


hello, is there anyone who have code for smoothing the output of the accelerometer..? for 2 servo txn :)


That's often just averaging a "few" reads -- 2,3,4 reads, average o/p -- whatever.


Try:  File / Examples / Analog / Smoothing


Try in loop:
new_value = A * get_new_value() + B * old_value;
old_value = new_value
where A + B = 1.0

for example A=0.1 and B=0.9, the smaller the A the stronger the low-pass filtering effect.


That's often just averaging a "few" reads -- 2,3,4 reads, average o/p -- whatever.

sir can you have example..? i got some code in the google but it's not working my newbie :) tnx


It has already been pointed out that the Arduino compiler comes with examples that shows how to do this.

I have over fourty years in designing and building computer systems. The first thing I did with my new Arduino is to compile test and run every example that I could get to work.

If I am not too proud to use the examples to learn -- maybe you could try it too. When I had trouble with specific items people were happy to help.

I will not write your code. Nor it seems will the other experienced people. It's just too much...

If you want a course for beginners -- use google -- maybe there are some tutorials.


"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.


i'ts working but a little bit un smooth.. sir what about Kalman method.>? it is good to used..?

Go Up