Pop lock n drop it

Dependencies:   m3pi_ng mbed

Revision:
6:36c597e4d07a
Parent:
5:f3805a1f9047
diff -r f3805a1f9047 -r 36c597e4d07a main.cpp
--- a/main.cpp	Thu May 22 11:54:41 2014 +0000
+++ b/main.cpp	Thu May 22 12:52:43 2014 +0000
@@ -74,54 +74,7 @@
 int main() {
 
     
-    m3pi_IN[0].mode(PullUp);
-    m3pi_IN[1].mode(PullUp);
-    
-    int start;
-    do 
-    {
-        start = pushToStart();  
-    }while(start == 1);
-    
-    wait(1);
-    //calibrates sensors
-    huey.sensor_auto_calibrate();  
-
-    printBattery();
-    
-    float speed = 0.25;
-    float pos;
-    int z=1;
-    while(z==1)
-    {
-        //huey.right_motor(speed);
-        pos = myLinePos();//huey.line_position();
-        smoothFollow(pos, speed);
-        if(m3pi_IN[0]==0)
-        {
-            slowStop(speed, 0.05, 3);
-            huey.stop();
-            while(m3pi_IN[0]==0)
-            {
-                huey.printf("Stuck");    
-            }
-        }
-
-    }
-
-    
-    
-    
-    
-    
-    while(1) 
-    {
-        myled = 1;
-        wait(0.2);
-        myled = 0;
-        wait(0.2);
-    }
-      //btbee trial
+     //btbee trial
     // initialization stuff ////////////////////////////////////////////////////////////////////////////////////////////////////
     huey.locate(0,1);
     btbee.reset();
@@ -184,7 +137,55 @@
         wait(0.1);
     }//while_true
 
-}//main
+//main
 //end of btbee trial
 
+    m3pi_IN[0].mode(PullUp);
+    m3pi_IN[1].mode(PullUp);
 
+    
+    int start;
+    do 
+    {
+        start = pushToStart();  
+    }while(start == 1);
+    
+    wait(1);
+    //calibrates sensors
+    huey.sensor_auto_calibrate();  
+
+    printBattery();
+    
+    float speed = 0.25;
+    float pos;
+    int z=1;
+    while(z==1)
+    {
+        //huey.right_motor(speed);
+        pos = myLinePos();//huey.line_position();
+        smoothFollow(pos, speed);
+        if(m3pi_IN[0]==0)
+        {
+            slowStop(speed, 0.05, 3);
+            huey.stop();
+            while(m3pi_IN[0]==0)
+            {
+                huey.printf("Stuck");    
+            }
+        }
+
+    }
+
+    
+    
+    
+    
+    
+    while(1) 
+    {
+        myled = 1;
+        wait(0.2);
+        myled = 0;
+        wait(0.2);
+    }
+}