servo motor

Dependencies:   mbed

Revision:
0:2933e08620c9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Apr 19 23:25:25 2017 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+
+DigitalOut my_led(LED1);
+DigitalOut my_pwm(P_A0); // IO used by pwm_io function
+
+int main(){
+    
+my_pwm.periodo_ms(20);
+
+while(1){
+    my_pwm.pulsewidth_ms(1);
+    wait(2);
+    my_pwm.pulsewidth_us(1500);
+    wait(2);
+    my_pwm.pulsewidth_ms(2);
+    wait(2);
+    }
+    
+}
\ No newline at end of file