QEI calculates distance of rotation if given diameter

Dependencies:   QEI mbed

Fork of QEI_HelloWorld by Aaron Berk

Files at this revision

API Documentation at this revision

Comitter:
jvfausto
Date:
Fri Aug 03 20:29:28 2018 +0000
Parent:
1:30696e4d196b
Commit message:
W/ distance

Changed in this revision

QEI.lib Show annotated file Show diff for this revision Revisions of this file
QEI_lib.lib 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 30696e4d196b -r f06a9b5fbeb4 QEI.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QEI.lib	Fri Aug 03 20:29:28 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/jvfausto/code/QEI/#2a173fdae3ca
diff -r 30696e4d196b -r f06a9b5fbeb4 QEI_lib.lib
--- a/QEI_lib.lib	Wed Aug 11 09:15:10 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/aberk/programs/QEI_lib/latest
\ No newline at end of file
diff -r 30696e4d196b -r f06a9b5fbeb4 main.cpp
--- a/main.cpp	Wed Aug 11 09:15:10 2010 +0000
+++ b/main.cpp	Fri Aug 03 20:29:28 2018 +0000
@@ -4,13 +4,14 @@
 //Use X4 encoding.
 //QEI wheel(p29, p30, NC, 624, QEI::X4_ENCODING);
 //Use X2 encoding by default.
-QEI wheel (p29, p30, NC, 624);
+QEI wheel (D0, D1, NC, 1200);
 
 int main() {
 
     while(1){
         wait(0.1);
-        pc.printf("Pulses is: %i\n", wheel.getPulses());
+        pc.printf("Distance is: %f \r\n", wheel.getDistance(31.75));
+
     }
 
 }
diff -r 30696e4d196b -r f06a9b5fbeb4 mbed.bld
--- a/mbed.bld	Wed Aug 11 09:15:10 2010 +0000
+++ b/mbed.bld	Fri Aug 03 20:29:28 2018 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da
+https://os.mbed.com/users/mbed_official/code/mbed/builds/a7c7b631e539
\ No newline at end of file