![](/media/cache/profiles/altb_JGUSAOG.jpg.50x50_q85.jpg)
corrections altb2
Lib_Misc/DiffCounter.h
- Committer:
- altb2
- Date:
- 2021-05-02
- Revision:
- 0:d2e117716219
File content as of revision 0:d2e117716219:
#ifndef DIFFCOUNTER_H_ #define DIFFCOUNTER_H_ #include <mbed.h> class DiffCounter { public: DiffCounter(float T, float Ts); DiffCounter(float T, float Ts, uint32_t incPerRev); DiffCounter(float T, float Ts, uint32_t incPerRev, float direction); float operator()(short inc) { return doStep(inc); } virtual ~DiffCounter(); void reset(float initValue, short inc); float doStep(int16_t inc); private: double b; double a; int16_t incPast; int16_t inc; double vel; double inc2rad; int32_t incPerRev; float direction; }; #endif /* DIFFCOUNTER_H_ */