Eurobot2012_Primary

Dependencies:   mbed Eurobot_2012_Primary

Revision:
24:7a3906c2f5d5
Parent:
23:1901cb6d0d95
Child:
25:143b19c1fb05
--- a/main.cpp	Fri May 04 02:50:07 2012 +0000
+++ b/main.cpp	Fri May 04 05:23:45 2012 +0000
@@ -36,10 +36,10 @@
 void vStop (void);
 
 //Main loop
-int main() {
+int main() {      
     // no motor motions till we pull the trig
     ai.flag_motorStop = true;
-    
+    nopwait(1000);
     Colour = ColourToggle;
     // re-defines beacon positions by the toggle switch
     kalman.statelock.lock();
@@ -71,7 +71,7 @@
     kalman.KalmanInit();
 
     //Thread tMotorThread(vMotorThread,NULL,osPriorityNormal,256);
-    //Thread tUpdateState(vPrintState,NULL,osPriorityNormal,1024);
+    Thread tUpdateState(vPrintState,NULL,osPriorityNormal,1024);
 
 
     pc.printf("We got to main! ;D\r\n");
@@ -134,6 +134,9 @@
     
 
     // attach a 87 seconds stop timer
+    
+    
+    //REPLACE TICKER!!!!
     StopTicker.attach(&vStop, 87);
 
 
@@ -147,27 +150,26 @@
 //if (Colour){
     // strat 1 RED ==================================
     ArmsOpen();
-    Thread::wait(500);    
-
+    //Thread::wait(500);    
+        
     // goto middle x
-    settarget(1500, 250, PI/2, true,Colour);
+    settarget(1500, 250, PI/2, true,Colour, 35);
     Thread::signal_wait(0x01);
     Thread::wait(2000);
-
-    
+        
     // to palm tree
-    settarget(1500, 1050, PI, true,Colour);
+    settarget(1500, 1000, PI, true,Colour, 35);
     Thread::signal_wait(0x01);
     Thread::wait(2000);
 
     // run over totem
-    settarget(640,1050,PI, true,Colour);
+    settarget(800,1050,PI, true,Colour, 60);
     Thread::signal_wait(0x01);
     Thread::wait(2000);
 
     ArmsClose();
     // back to ship
-    settarget(220,780,PI,true,Colour);   
+    settarget(220,780,PI,true,Colour, 35);   
     Thread::signal_wait(0x01);
     Thread::wait(2000);
 //}
@@ -195,6 +197,7 @@
     Thread::wait(2000); 
 }
 */
+/*
 // going from ship to ship for the remaining secs
     while (true){
     // back to home, RED
@@ -207,6 +210,7 @@
     Thread::signal_wait(0x01);
     Thread::wait(2000);
     }
+    */
 
     // terminate thread, stopps motors permanently
     ai.flag_terminate = true;