PIDs and fun

Dependencies:   btbee m3pi_ng mbed FatFileSystemCpp

Revision:
4:0bcd7a924140
Parent:
3:ebe015c72bba
Child:
5:3f29267b18e3
--- a/main.cpp	Wed May 27 11:49:58 2015 +0000
+++ b/main.cpp	Wed May 27 12:03:05 2015 +0000
@@ -22,7 +22,6 @@
 int main() {
     
     
-while(1) {
     
     btbee.reset();
     m3pi_pb.mode(PullUp);
@@ -100,12 +99,14 @@
         
     if(m3pi_IN [0] == 0 and IR == 0) {
         while (m3pi_IN [0] == 0 and IR == 0) {
-    btbee.printf("Obstacle detected. Please remove to continue");
+    m3pi.cls();
+    btbee.printf("Obstacle detected. Ending program");
+    m3pi.printf("ABORT");
     m3pi.stop();
-    wait(3.0);
+    exit(1);
     }
 }
-        IR = 1;
+
         
        // Get the position of the line.
         current_pos_of_line = m3pi.line_position();        
@@ -221,6 +222,6 @@
     
 }
 
-}
 
 
+