Michael Ernst Peter / PM2_Libary

Dependencies:   LSM9DS1 RangeFinder FastPWM

Dependents:   PM2_Example_PES_board PM2_Example_PES_board PM2_Example_PES_board PM2_Example_PES_board ... more

AvgFilter.h

Committer:
pmic
Date:
2022-05-05
Revision:
26:6c326a352f1b
Parent:
24:f2614d8577a1
Child:
27:fdb94d0b5d87

File content as of revision 26:6c326a352f1b:

#ifndef AVGFILTER_H_
#define AVGFILTER_H_

#include <mbed.h>

class AvgFilter
{
public:
    AvgFilter(){};
    AvgFilter(uint8_t _N);
    virtual ~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_ */