![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ICRS Eurobot 2013
Dependencies: mbed mbed-rtos Servo QEI
Diff: Sensors/Encoders/Encoder.h
- Revision:
- 1:8119211eae14
- Parent:
- 0:200635fa1b08
- Child:
- 5:56a5fdd373c9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sensors/Encoders/Encoder.h Fri Mar 29 16:28:56 2013 +0000 @@ -0,0 +1,29 @@ + +// Eurobot13 Encoder.cpp + +#include "QEI.h" +#include "mbed.h" + +class Encoder{ +private: + DigitalIn green, yellow; + QEI wheel; + +public: + Encoder(PinName pGreen, PinName pYellow) + : green(pGreen) + , yellow(pYellow) + , wheel(pGreen,pYellow, NC, 624) + { + green.mode(PullUp); + yellow.mode(PullUp); + } + + int getPoint(void){ + return wheel.getPulses(); + } + + void reset (void){ + return wheel.reset(); + } +};