Time is good

Dependencies:   RoboClaw mbed

Fork of Robot2016_2-0 by ARES

Revision:
47:be4eebf40568
Parent:
45:b53ae54062c6
Child:
49:5e2f7323f280
--- a/main.cpp	Wed Apr 13 12:47:47 2016 +0000
+++ b/main.cpp	Mon Apr 25 12:42:32 2016 +0000
@@ -1,4 +1,5 @@
 #include "func.h"
+#include "map.h"
 
 #define ATTENTE 0
 #define GO 1
@@ -33,8 +34,8 @@
 
 Ticker ticker;
 
-Serial logger(USBTX, USBRX);
-//Serial logger(PA_9, PA_10);
+//Serial logger(USBTX, USBRX);
+Serial logger(PA_9, PA_10);
 RoboClaw roboclaw(460800, PA_11, PA_12);
 Odometry odo(61.7, 61.8, ENTRAXE, 4096, roboclaw);
 
@@ -46,19 +47,37 @@
 /* Debut du programme */
 int main(void)
 {
-    init();
-    while(1) JPO();
+    init();    
+    
+    /*map m(&odo);
+    m.addObs(obsCarr (1250, 1000, 220, 220));
+    m.addObs(obsCarr (1500, 750, 220, 220));
+    m.addObs(obsCarr (1500, 1250, 220, 220));
+    
+    m.Execute(1000,1000);
+    m.Execute(1500,1000);
+    m.Execute(1500,1500);
+    m.Execute(110,1000);
+    
+    odo.GotoThet(0);
+    
+    roboclaw.ForwardM1(ADR, 0);
+    roboclaw.ForwardM2(ADR, 0);
+    
+    logger.printf ("Chemin Fini !");*/
+    odo.GotoXY(500,1000);
+    while (1);
 }
 
 void init(void)
 {
+    odo.setPos(110, 1000, 0);
     roboclaw.ForwardM1(ADR, 0);
     roboclaw.ForwardM2(ADR, 0);
     logger.baud(9600);
     logger.printf("Hello from main !\n\r");
+    bleu = 1, blanc = 1, rouge = 1;
     wait_ms(500);
-    bleu = 1, blanc = 1, rouge = 1;
-    wait_ms(1000);
     bleu = 0, blanc = 0, rouge = 0;
     
     while(button);