![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Colour sensors calibrated
Dependencies: mbed-rtos mbed Servo QEI
Fork of ICRSEurobot13 by
Diff: Sensors/Encoder/Encoder.h
- Revision:
- 0:200635fa1b08
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sensors/Encoder/Encoder.h Fri Mar 29 11:35:34 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(); + } +};