PWM Intervalo 10us hasta 180º

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
JuanCamilo93
Date:
Thu Feb 15 02:24:55 2018 +0000
Commit message:
PWM-intervalos 10us hasta 180?

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
diff -r 000000000000 -r f7e145caa35a main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Feb 15 02:24:55 2018 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+
+PwmOut mypwm(PA_10);
+
+DigitalOut myled(LED1);
+
+int main() {
+    
+    int Pos=1000;
+    
+    while(Pos<=2000){
+        
+    mypwm.period_ms(20);
+    mypwm.pulsewidth_us(Pos);    
+        wait(1);
+        Pos+=100;
+        
+        }
+    while(1) {
+        myled = !myled;
+        wait(1);
+    }
+}
diff -r 000000000000 -r f7e145caa35a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Feb 15 02:24:55 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/7130f322cb7e
\ No newline at end of file