servomotor

Dependencies:   mbed

Revision:
0:36de5330e386
diff -r 000000000000 -r 36de5330e386 pwmprueba.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pwmprueba.cpp	Thu Apr 20 00:23:57 2017 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+
+PwmOut mipwm(PA_0); // IO used by pwm_io function
+PwmOut mipwm2(PA_1);
+
+
+
+int main(){
+    
+    
+mipwm.period_ms(20);
+
+while(1){
+    mipwm.pulsewidth_us(2000);
+    wait(1);
+    
+     mipwm2.pulsewidth_us(2000);
+    wait(1);
+    
+    mipwm.pulsewidth_us(700);
+    wait(1);
+    
+   
+    mipwm2.pulsewidth_us(1400);
+    wait(1);
+    mipwm2.pulsewidth_us(700);
+    wait(1);
+    }
+    
+
+    
+}
\ No newline at end of file