se debe completar el código que falta de la función vertex2d para generar la figura

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
fabeltranm
Date:
Wed Mar 07 00:03:12 2018 +0000
Parent:
1:370d6730c1cf
Commit message:
add nodraw

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 370d6730c1cf -r 878cb2697ab1 main.cpp
--- 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;
      }
 
 }