Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: LSM9DS1 RangeFinder FastPWM
Dependents: PM2_Example_PES_board PM2_Example_PES_board PM2_Example_PES_board PM2_Example_PES_board ... more
Diff: AvgFilter.h
- Revision:
- 24:f2614d8577a1
- Child:
- 26:6c326a352f1b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AvgFilter.h Thu May 05 07:40:34 2022 +0000 @@ -0,0 +1,24 @@ +#ifndef AVGFILTER_H_ +#define AVGFILTER_H_ + +#include <mbed.h> + +class AvgFilter +{ +public: + AvgFilter(){}; + AvgFilter(uint8_t _N); + ~AvgFilter(); + + void setup(uint8_t _N); + void reset(); + float update(float _inp); + +private: + float m_avg; + uint8_t m_N; + uint8_t m_idx; + float *m_ring_buffer; +}; + +#endif /* AVGFILTER_H_ */ \ No newline at end of file