Dependents: nhk_2018_undercarry_test04 nhk_2018_undercarry_test08 nhk_2018_undercarry_test09 nhk_2018_undercarry_test10 ... more
Diff: encoder.h
- Revision:
- 0:0d6f91c4a794
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/encoder.h Thu Mar 22 05:55:17 2018 +0000 @@ -0,0 +1,22 @@ +#ifndef ENCODER_H +#define ENCODER_H + +#include "mbed.h" + +class Encoder{ +public : + Encoder(PinName APin, PinName BPin, PinName ZPin); + float read_rotate(); + int read_z(); + void init(); +private : + InterruptIn A; + DigitalIn B; + DigitalIn Z; + int count; + int zcount; + void flag(); +}; + +#endif +