Kazushi Yamanobe
/
R-ciliatable_4
latest version 9/26
Diff: EC12E2420801.h
- Revision:
- 0:0d02a451e79d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/EC12E2420801.h Sun Oct 10 04:47:14 2021 +0000 @@ -0,0 +1,33 @@ +#ifndef ENCODER_H +#define ENCODER_H + +#include "mbed.h" + +/****定数****/ +#define PI 3.1415f +#define RADIAN 360 +#define MINUTE 60 +#define CALCULATE_PERIOD 0.01f + +enum DATA_CATEGORY{ + COUNT, +}; + + +class Encoder { + public: + Encoder(PinName Apulse,PinName Bpulse); + float getData(short ch); + bool reset(int preset = 0); + + private: + InterruptIn Apulse; + InterruptIn Bpulse; + + void Apulse_Down(); + + int preset; + float count; +}; + +#endif \ No newline at end of file