MechA04 / Mbed 2 deprecated Nucleo_pwm_A4

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
MechA042
Date:
Thu Oct 06 04:07:54 2016 +0000
Commit message:
motor_test

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 Oct 06 04:07:54 2016 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+
+PwmOut mypwm(D3);
+
+
+int main() {
+    
+    mypwm.period(0.01);
+    //mypwm.write(0.15);
+    //mypwm.pulsewidth(0.0015);
+    
+    while(1){
+        mypwm.write(0.15);
+        printf("pwm set to %.2f %%\n", mypwm.read() * 100);
+        wait(1);
+        mypwm.write(0.18);
+        printf("pwm set to %.2f %%\n", mypwm.read() * 100);
+        wait(1);
+        mypwm.write(0.15);
+        printf("pwm set to %.2f %%\n", mypwm.read() * 100);
+        wait(1);
+        mypwm.write(0.12);
+        printf("pwm set to %.2f %%\n", mypwm.read() * 100);
+        wait(1);
+        
+    }
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 06 04:07:54 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3
\ No newline at end of file