Julesnaps / Mbed 2 deprecated Linefollowproject

Dependencies:   m3pi mbed

Revision:
88:55cd0d863d4f
Parent:
87:88aebb4c7226
Child:
89:5ea90b86fefb
--- a/main.cpp	Tue Oct 25 10:05:16 2022 +0000
+++ b/main.cpp	Tue Oct 25 10:16:14 2022 +0000
@@ -10,7 +10,7 @@
 DigitalOut led2(LED2);
 DigitalOut led3(LED3);
 DigitalOut led4(LED4);
-int startTime;
+float startTime;
 
 // Minimum and maximum motor speeds
 #define MAX 0.65
@@ -22,7 +22,7 @@
 #define D_TERM 20
 
 //  Ccount before test
-#define CYCLEBEFORETEST 4500
+#define CYCLEBEFORETEST 450
 
 // Textfile paths
 #define PITLOGPATH "/local/pitlog.txt"
@@ -50,7 +50,6 @@
     timer.start();
     startTime = timer.read();
 
-
     /*Base program Variable initiation*/
     float right;
     float left;
@@ -80,7 +79,7 @@
         if (ccount % CYCLEBEFORETEST == 0 && gotoPit == 0)
         {
             TE_LogVoltage(ccount);
-            gotoPit = PS_BatteryTest();
+           // gotoPit = PS_BatteryTest();
         }
         if (gotoPit == 1)
         {
@@ -370,7 +369,7 @@
     FILE *fptr; /* voltagelog adres */
     fptr = fopen(VOLTAGELOGPATH,"a");
   
-    fprintf(fptr,"%8d,%8d,%4.4f,%4.4f\n"  , timer.read()-startTime, count, m3pi.battery(),m3pi.pot_voltage()  );
+    fprintf(fptr,"%8lf ; %8d ; %4.4f; %4.4f \n"  , (timer.read()-startTime), count, m3pi.battery(),m3pi.pot_voltage()  );
     fclose(fptr);
 
 }