first commit

Dependencies:   mbed MMA8451Q

Files at this revision

API Documentation at this revision

Comitter:
aalawfi
Date:
Mon Nov 22 22:27:14 2021 +0000
Parent:
33:0a1e29085b79
Commit message:
- 3 Laps, fastest is ~~12.3s

Changed in this revision

driving.h Show annotated file Show diff for this revision Revisions of this file
steering_header.h Show annotated file Show diff for this revision Revisions of this file
diff -r 0a1e29085b79 -r cb9a0cec2feb driving.h
--- a/driving.h	Mon Nov 22 21:54:27 2021 +0000
+++ b/driving.h	Mon Nov 22 22:27:14 2021 +0000
@@ -58,7 +58,6 @@
 float x;
 
 Timer t;
-Timer laptimer;
 
 bool clampLeft = false;
 bool clampRight = false;
@@ -150,13 +149,13 @@
             enable_brakes();
           t.start();
         
-            if (t.read_ms() > 50)
+            if (t.read_ms() > 150)
             {
             disable_brakes();
             t.stop();    
             }    
-            setpointLeft = 0.23;
-           setpointRight = 0.23;
+            setpointLeft = 0.21;
+           setpointRight = 0.21;
             }
         else if(counter == 3 && lap == 1 )
         {
@@ -174,7 +173,7 @@
           enable_brakes();
           t.start();
         
-            if (t.read_ms() > 100)
+            if (t.read_ms() > 600)
             {
             disable_brakes();
             t.stop();    
@@ -198,7 +197,7 @@
         }
         if (lap == 2 && counter == 0)
         {
-         lapTimerFinal = lapTimerCount;   
+         lapTimerFinal = lapTimerCount / 1000;   
         }    
         
     
diff -r 0a1e29085b79 -r cb9a0cec2feb steering_header.h
--- a/steering_header.h	Mon Nov 22 21:54:27 2021 +0000
+++ b/steering_header.h	Mon Nov 22 22:27:14 2021 +0000
@@ -47,4 +47,4 @@
 volatile bool steering_enabled = true;
 Ticker steering_control_ticker;
 int counter=0;
-int lap=0; 
+int lap=-1;