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
--- /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
--- /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++;
+    }
+}
--- /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