Measurement Rotational speed

Dependencies:   mbed QEI

Files at this revision

API Documentation at this revision

Comitter:
st17099ng
Date:
Fri Feb 01 13:55:38 2019 +0000
Commit message:
Moter test

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 7e12615059e4 QEI.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QEI.lib	Fri Feb 01 13:55:38 2019 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/kikoaac/code/QEI/#a24686ca50ab
diff -r 000000000000 -r 7e12615059e4 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Feb 01 13:55:38 2019 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+#include "QEI.h"
+
+Serial pc(USBTX,USBRX);
+
+QEI encorder1(D7,D8,NC,100,QEI::X4_ENCODING);
+
+int main()
+{
+    int i=1;
+    float rpm = 0;
+    wait(1);
+    while(1) {
+        rpm = encorder1.getRPM();
+        pc.printf("%d,%lf\n",i,rpm);
+        i++;
+    }
+}
diff -r 000000000000 -r 7e12615059e4 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Feb 01 13:55:38 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/a7c7b631e539
\ No newline at end of file