Lol smth

Dependencies:   LocalPositionSystem MMA8451Q Motor_Driver Sensors mbed

Fork of TDP_main_BartFork by Yelfie

Revision:
20:198dc13777eb
Parent:
19:d277614084bc
Child:
21:e8da3b351cd0
--- a/main.cpp	Thu Mar 19 16:57:30 2015 +0000
+++ b/main.cpp	Fri Mar 20 11:40:57 2015 +0000
@@ -156,37 +156,45 @@
     
 
    // pc.printf("Start...");
-    
-    
-//    while (1) {
-//       
-//       if (driveMode == REGULAR) {
-//          measureSensors();
-//          switch (sensorsCheckSum) {
-//            case 74: //all right are white,else is good TURN RIGHT
-//                break;
-//            case 78: //RLD is black, all else good
-//                break;
-//            case 90: //RLU is black,all else good
-//                break;
-//            
-//            case 94: //keep straight
-//                pc.printf ("only Right is white \n");
-//                break;
-//            case 95 :   //RRU is white
-//                pc.printf ("only Left is white \n");
-//                break;
-//            case 103 :  //RRD is white all else normal
-//                pc.printf ("both are white \n");
-//                break;
-//            
-////          case 91: 
-////            driveMode = SQUARE; //if all sensors are white you're in the square
-////            break;
-//          default: //checksum is zero , all are black
-//            pc.printf ("BLACK BLACK");
+    /*
+    int testOtherCases = 0; //needed for control statements
+    while (1) {
+       
+       if (driveMode == REGULAR) {
+          measureSensors();
+          switch (sensorsCheckSum) {
+            case 94: //go straight
+                break;
+            case 95: //Turn right seriously
+                break;
+            case 104: //Turn right as well
+                break;
+            
+            case 158: //Turn left seriously
+                pc.printf ("only Right is white \n");
+                break;
+            case 194 :   //Turn left seriously again
+                pc.printf ("only Left is white \n");
+                break;
+            case 103 :  //RRD is white all else normal
+                pc.printf ("both are white \n");
+                break;
+            
+//          case 204: 
+//            driveMode = SQUARE; //if all sensors are white you're in the square
 //            break;
-//          } 
+          default: //checksum is zero , all are black
+            testOtherCases = 1; 
+            break;
+          } 
+          if (testOtherCases == 1) {
+            if (sensorsCheckSum < 96){ // adjust right
+                }   
+            else   {//adjust left
+                }
+            testOtherCases = 0;
+          }    
+          */
 //              
 //        
 //