Biorobotics / Mbed 2 deprecated Encoder_reading_counting

Dependencies:   QEI mbed

Files at this revision

API Documentation at this revision

Comitter:
yohoo15
Date:
Wed Sep 23 14:35:14 2015 +0000
Commit message:
Count the encoder signal

Changed in this revision

QEI.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QEI.lib	Wed Sep 23 14:35:14 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/aberk/code/QEI/#5c2ad81551aa
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 23 14:35:14 2015 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+#include "QEI.h"
+ 
+Serial pc(USBTX, USBRX);
+//Use X4 encoding.
+//QEI wheel(p29, p30, NC, 624, QEI::X4_ENCODING);
+//Use X2 encoding by default.
+QEI wheel (PTC10, PTC11, NC, 624);
+
+// Define pin for motor control
+DigitalOut directionPin(D4);
+DigitalOut PWM(D5);
+ 
+int main() {
+ 
+ 
+                    directionPin.write(1);
+                    PWM.write(1);
+                   
+    while(1){
+        wait(0.1);
+        pc.printf("Pulses is: %i\n", wheel.getPulses());
+    }
+ 
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Sep 23 14:35:14 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa
\ No newline at end of file