Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed QEI-1 nRF24L01P xiugai
Diff: main.cpp
- Revision:
 - 0:e63858fec119
 - Child:
 - 1:1e3eb2d1496b
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Apr 30 13:48:51 2018 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+#include "QEI.h"
+Serial pc(PA_2, PA_3);
+PwmOut mypwm1(PB_7);
+PwmOut mypwm2(PB_6);
+QEI wheel(PB_10, PB_11, NC, 11, QEI::X4_ENCODING);
+int x;
+int main() {
+      
+    mypwm1.period_ms(2);
+    mypwm2.period_ms(2);
+    mypwm1.pulsewidth(0.001);
+    mypwm2.pulsewidth(0.001);
+    while(1)
+    {
+      wait(0.1);
+      x = wheel.getPulses();
+        pc.printf("Pulses is: %i\n", x);
+    }   
+}