The encoder DRS exercise

Dependencies:   MODSERIAL QEI mbed

Revision:
0:9aa5fb3f9174
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 23 13:14:09 2015 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+#include "QEI.h"
+#include "MODSERIAL.h"
+
+DigitalOut gpo(D0);
+DigitalOut led(LED_RED);
+
+QEI motor1(D13,D12,NC, 624);
+MODSERIAL pc(USBTX,USBRX);
+
+int main()
+{  
+   pc.baud(115200);
+
+   while(1) {
+       wait(0.2);
+       pc.printf("the amount of pulses is: %d\r\n",motor1.getPulses());
+       // the amount of counts for one revolution is 32
+       //this is X2 encodng, as the QEI usus X2 by default 
+       //and the motor encoder has a X4 encoder and thus 64 counts per revolution
+       // X unit counts equals one magnet shaft rotation, with X being 64
+       //thus keeping in mind the gearbox the amount of counts for a gearbox revolution is 8400
+   }
+   }
\ No newline at end of file