Andres Castañeda / Mbed 2 deprecated 01-01servos

Dependencies:   mbed

Fork of 01-01SolucionFuncionXY by ferney alberto beltran molina

Revision:
2:878cb2697ab1
Parent:
1:370d6730c1cf
Child:
3:fe8e265eaf6e
--- a/main.cpp	Tue Feb 20 00:39:23 2018 +0000
+++ b/main.cpp	Wed Mar 07 00:03:12 2018 +0000
@@ -6,6 +6,18 @@
 PwmOut myServoY(PB_4);
 
 
+void draw()
+{
+    
+    // ubicar  el codigo respectivo para  mover el eje z y dibujar 
+    
+}
+void nodraw()
+{
+    
+    // ubicar  el codigo respectivo para  mover el eje z y no dibujar 
+    
+}
 
 void vertex2d(float x, float y){
 
@@ -31,14 +43,17 @@
     myServoY.period_ms(20);
     int posx=0;
     int posy=0;
+    draw();
     while(1)
     {
         wait(2);
         vertex2d(posx,posy);
         posx+=10;
-        posy+=10;
-        if (posx>50) posx=0;
-        if (posy>50) posy=0;
+        if (posx>50){
+            posx=0;
+            nodraw();
+        }
+        posy=posy;
      }
 
 }