Julesnaps / Mbed 2 deprecated Linefollowproject

Dependencies:   m3pi mbed

Files at this revision

API Documentation at this revision

Comitter:
mikkelbredholt
Date:
Thu Oct 27 11:13:59 2022 +0000
Parent:
89:5ea90b86fefb
Commit message:
BatteriCheckMedOptimerede v?rdier1

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Oct 25 14:54:45 2022 +0000
+++ b/main.cpp	Thu Oct 27 11:13:59 2022 +0000
@@ -168,14 +168,14 @@
 int PS_BatteryTest(void){
 /* Test battery voltage, if the robot is not headed for pit */ 
     
-    const float BATVOLTTRESHOLD = 0.05; // Treshold i volt
+    const float BATVOLTTRESHOLD = 4.2; // Treshold i volt
     int result = 0;
     int BatteryTestCounter;
     
     /*Test if the voltage is below the threshold if true 10 times in row,
      turn on go to pit mode*/
     if (m3pi.battery() <= BATVOLTTRESHOLD ){  
-        if (++BatteryTestCounter > 10){
+        if (++BatteryTestCounter > 3){
             result = 1; // Set goto pit condition
             LED_Control(1, 1);
             m3pi.cls();