Julesnaps / Mbed 2 deprecated Linefollowproject

Dependencies:   m3pi mbed

Revision:
67:990fbcfee16f
Parent:
66:6403ec154b77
Child:
68:bb2ee5b4f9dd
--- a/main.cpp	Wed Oct 12 10:48:42 2022 +0000
+++ b/main.cpp	Wed Oct 12 10:49:29 2022 +0000
@@ -19,8 +19,8 @@
 #define I_TERM 0
 #define D_TERM 20
 
-//  loopcount before test
-#define LOOPSBEFORETEST 9000
+//  Ccount before test
+#define CYCLEBEFORETEST 4500
 
 // Textfile paths
 #define PITLOGPATH "/local/pitlog.txt"
@@ -57,7 +57,7 @@
 
     /*Team 7 Variabels*/
     int gotoPit = 0; // wether or not the robot is heading to pit. Initialstate false. 
-    int loopcount = 0; //used to count loops
+    int ccount = 0; //used to count cycles
     
     /*Printing secret cat mission*/
     LCD_InitialMessages();
@@ -69,12 +69,10 @@
 
     while (1) {
         /* If cycle count divided by 100 does not have a rest. test if pit */
-        if (loopcount % LOOPSBEFORETEST == 0 && gotoPit == 0)
+        if (ccount % CYCLEBEFORETEST == 0 && gotoPit == 0)
         {
-
-            TE_LogVoltage(loopcount);
+            TE_LogVoltage(ccount);
             gotoPit = PS_BatteryTest();
-
         }
         if (gotoPit == 1)
         {
@@ -119,7 +117,7 @@
         m3pi.left_motor(left);
         m3pi.right_motor(right);
         
-    loopcount++;
+    ccount++;
     }
     // PS_DisplayNumberofPS();
     
@@ -221,14 +219,11 @@
 
 void PS_PitStop(void)
 {
-    
     m3pi.stop();       // stop all engine
-    
     // increase counter with one
     while (1)
     {
         LED_Blink (1);      // signal in pit
-        
     }
 }