first commit

Dependencies:   mbed MMA8451Q

Revision:
5:636c3fe18aa8
Parent:
4:8b1d52dab862
Child:
6:d2bd68ba99c9
--- a/state_control.h	Mon Oct 25 01:53:10 2021 +0000
+++ b/state_control.h	Mon Oct 25 02:14:11 2021 +0000
@@ -32,20 +32,20 @@
     // TODO: Activate brakes. Example: 
     // left_brakes_enabled = true; 
     // right_brakes_enabled = true; 
-    // motor_enabled = false;  
+    motor_enabled = false;  
     turn_led(RED); 
  
     }; 
 void _run(void){
     // TODO: realease brakes, start the motors 
-    // motor_enabled = true; 
+    motor_enabled = true; 
     turn_led(GREEN); 
     };
 void _wait(void){
      // release brakes, turn on steering system, do not start the motor
      // left_brakes_enabled = false; 
      // right_brakes_enabled = false; 
-     // motor_enabled = false;
+    motor_enabled = false;
     steering_enabled = true;
      turn_led(YELLOW);
      };
@@ -66,14 +66,12 @@
 enum fault_list {CLEAR,OFF_TRACK, BUMPER, LOW_VOLTAGE};
 fault_list fault_type=CLEAR;
 void fault_check(void){
-  
     if (left_distance_sensor.read()*3.3 < 0.700 && right_distance_sensor.read()*3.3 < 0.700)
         {
           _fault = true;
           fault_type = OFF_TRACK;
         }
     else { 
-   
         _fault = false; 
         fault_type = CLEAR;
         };