encoder test

Dependencies:   QEI mbed

Files at this revision

API Documentation at this revision

Comitter:
neoqased
Date:
Mon Oct 20 11:12:07 2014 +0000
Commit message:
aaaa

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
diff -r 000000000000 -r cc481a1f6157 QEI.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QEI.lib	Mon Oct 20 11:12:07 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/aberk/code/QEI/#5c2ad81551aa
diff -r 000000000000 -r cc481a1f6157 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Oct 20 11:12:07 2014 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+#include "QEI.h"
+
+#define PULSE_PER_REVOLUTION 200
+
+Serial pc(USBTX, USBRX);
+QEI motor(p26, p26, NC, PULSE_PER_REVOLUTION, QEI::X2_ENCODING);
+
+int main(){
+    pc.baud(57600);
+    motor.reset();
+
+    while(1) {
+        pc.printf("%d\n",motor.getPulses());
+        motor.reset();
+        wait(0.5);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r cc481a1f6157 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Oct 20 11:12:07 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013
\ No newline at end of file