a
Dependencies: mbed LidarLitev2
Diff: rori.h
- Revision:
- 0:48dbc1f972f1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rori.h Sun Sep 29 09:41:46 2019 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" + +#ifndef RORIRORI +#define RORIRORI +class RORI{ + public: + RORI(PinName a,PinName b); + void loli(); + void read(long *a); + bool getflag(); + private: + volatile short old; + volatile short dir; + volatile long enc_count; + InterruptIn pinA; + InterruptIn pinB; + DigitalIn DigA; + DigitalIn DigB; + bool flag; + }; +#endif +/* +float corr(long *one,long *two){ + const float Gein = 0.0001; + int def = *one - *two; + float out; + if(def > 0)out = def*Gein; + else if(def < 0)out = -def*Gein; + return(out); + } +*/ \ No newline at end of file