Camilo Ramirez / Mbed 2 deprecated pruebaservo1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Camilokingxd
Date:
Sat Mar 10 15:33:43 2018 +0000
Commit message:
PRUEBA 1;

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	Sat Mar 10 15:33:43 2018 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+PwmOut sg90azul(PB_9);//SE NOMBRA OBJETO Y SE ESTABLECE PIN DEL OBJETO
+DigitalOut ledgrande(LED1);//SE PROGRAMA EL LED A UTILIZAR 
+int a=1,x=500;
+int main() 
+{ 
+    sg90azul.period_ms(20);
+    while (a<=18)
+    {
+        sg90azul.pulsewidth_us(x);
+        wait_ms(1000);
+        x=x+120;
+        a++;
+        if(a==18)
+        {
+            while(a>1)
+            {
+                sg90azul.pulsewidth_us(x);
+                wait_ms(1000);
+                x=x-120;
+                a--; 
+            }
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Mar 10 15:33:43 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/7130f322cb7e
\ No newline at end of file