Bismarck / Mbed 2 deprecated ESC_TEST_CODE

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
tsillen
Date:
Thu Apr 30 21:57:52 2015 +0000
Commit message:
Working code, verified with scope

Changed in this revision

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/main.cpp	Thu Apr 30 21:57:52 2015 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+
+PwmOut mypwm(A0);
+
+DigitalOut myled(LED1);
+
+int main() {
+    
+    mypwm.period_ms(20);    //20ms period voor esc
+    mypwm.pulsewidth_us(1500); //neutraal voor cal
+    wait(3);    //give esc cal neutral some time , this is just a random value
+    mypwm.pulsewidth_us(1400); //reverse
+    wait(1);
+    mypwm.pulsewidth_us(1600); //forward
+    wait(1);
+    mypwm.pulsewidth_us(1500); //neutraal
+
+    
+// printf("pwm set to %.2f %%\n", mypwm.read() * 100);   
+//    while(1) {
+//        myled = !myled;
+//        wait(1);
+//    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Apr 30 21:57:52 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8ab26030e058
\ No newline at end of file