first commit

Dependencies:   mbed MMA8451Q

Revision:
33:0a1e29085b79
Parent:
32:ec8c9a82d9fc
Child:
34:cb9a0cec2feb
--- a/driving.h	Mon Nov 22 21:51:57 2021 +0000
+++ b/driving.h	Mon Nov 22 21:54:27 2021 +0000
@@ -67,6 +67,9 @@
 bool brakeLeftBool = false;
 bool brakeRightBool = false;
 
+double lapTimerCount = 0;
+double lapTimerFinal = 0;
+
 volatile bool are_brakes_activated; // Used for debugging 
 void disable_brakes(void){
     are_brakes_activated = false;
@@ -189,6 +192,15 @@
             }
         
         
+        if (lap == 1)
+        {
+        lapTimerCount = lapTimerCount + 1;    
+        }
+        if (lap == 2 && counter == 0)
+        {
+         lapTimerFinal = lapTimerCount;   
+        }    
+        
     
        //  setpointLeft = 0.1;
     //     setpointRight = 0.1;