pepe

Dependencies:   mbed Matrix

Revision:
1:2716ea33958b
Parent:
0:a7324f51348d
Child:
2:06b7789c7da0
--- a/main.cpp	Wed Mar 13 23:04:14 2019 +0000
+++ b/main.cpp	Wed May 22 09:51:53 2019 +0000
@@ -2,37 +2,49 @@
 #include "Robot.h"
 #include "Communication.h"
 
-Serial pc(SERIAL_TX, SERIAL_RX);
+//Serial pc(SERIAL_TX, SERIAL_RX);
 InterruptIn button(USER_BUTTON);
 
 volatile bool mode=true;
-float x1=40,y1=-40;          // Posição inicial do robo
-float a1=1,b1=-2,c1=4;       // Reta ax + by + c = 0
-float x2=50,y2=50,phi2=pi/2; // Pose arbitrária
+float x1=20,y1=20;          // Posição inicial do robo
+float a1=0,b1=-1,c1=65;       // Reta ax + by + c = 0
+float x2=65,y2=60,phi2=-pi/2; // Pose arbitrária
+int p[2] = {100,100};
+int p1[2] = {140, 80};
+int p2[2] = {140, 35};
+int p3[2] = {140, 130};
 
 void pressed()
 {
-    mode= !mode;
+    mode = !mode;
 }
 
 int main()
 {
-    pc.baud(9600);
+    //pc.baud(9600);
     button.fall(&pressed);
+    setSpeeds(0,0);
+    //wait(0.2);
+    mapa(80,80);
+    cria_obj(60,40,p);
+    //cria_obj(20,10,p1);
+    //cria_obj(20,60,p2);
+    //cria_obj(20,40,p3);
 
+    //int_map(80, 80);
     while(1) {
         if (mode==true) {
             setSpeeds(0,0);
 
-        } else {
+        } 
+        else {
             setSpeeds(0,0); 
             
             motion();
             wait(1);
             
-            //to_point(x1,y1);
-            //to_line(a1,b1,c1);
-            to_pos(x2,y2,phi2);
+            VFF();
+            //mode = true;
         }
     }
 }
\ No newline at end of file