An array 3 sized circle buffer
Diff: CircleBuffer.h
- Revision:
- 0:410ebbfd5e14
- Child:
- 1:8c7e5801d763
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CircleBuffer.h Tue Oct 15 16:32:18 2013 +0000 @@ -0,0 +1,26 @@ +// Circle Buffer +// A circle buffer of fixed size, set by BUFFERSIZE that will remove +// the oldest data when new ones are inserted. + +#ifndef CIRCLEBUFFER_H +#define CIRCLEBUFFER_H + +#define BUFFERSIZE 8 + +class CircleBuffer +{ + public: + CircleBuffer(void); + void queue(float value[3]); + void read(float rawfilter[3]); + + private: + float buffer[BUFFERSIZE][3]; + float buffersum[3]; + int index; // Keep track of front queue; + +}; + + + +#endif \ No newline at end of file