Go Down

Topic: Does arduino C++ have queue, stack, and basic stats classes? (Read 6 times) previous topic - next topic

liudr

Thank you robtillaart! I have made something very similar. My purpose is to detect disturbance to a box through the large STDEV on the accelerometer. Just a few measurements is needed. I'll need a real running avg for some other functions I'm thinking of.

JanD

See this: http://www.arduino.cc/playground/Main/GeneralCodeLibrary#DSA_code

There are dynamic stacks and dynamic queues. Each has a linked list version and a array version.

Jan

robtillaart

#7
Jan 30, 2011, 06:39 pm Last Edit: Jan 30, 2011, 07:02 pm by robtillaart Reason: 1
Hi Liudr,

I'm currently posting a runningAverage class in the playground - http://arduino.cc/playground/Main/RunningAverage - based upon your need. The class uses floats but can easily be rewritten to use int or long values. I first thought to add it to the simple stat library but I like to keep the footprint of that lib as small as possible so the runningAverage with its dynamic footprint is in conflict. But feel free to merge or adapt to your own need.

Thanks for the inspiration !

Rob.

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

liudr

Hey thank you Rob! As I replied on the other thread, I love it!

Go Up