Julesnaps / Mbed 2 deprecated Linefollowproject

Dependencies:   m3pi mbed

Revision:
12:6fe33785b0f4
Parent:
11:d13596393d56
Child:
79:9d46b0d532e1
diff -r d13596393d56 -r 6fe33785b0f4 main.cpp
--- a/main.cpp	Thu Oct 06 11:36:30 2022 +0000
+++ b/main.cpp	Thu Oct 06 11:42:11 2022 +0000
@@ -107,10 +107,6 @@
     
     float batVol = m3pi.battery();  //Storing battery voltage in variable
     const float BATVOLTRESHOLD = 3.0; // Treshold i volt
-    
-    /*Digital outs*/
-    DigitalOut led1(LED1);
-    led1 = 0; // Turn off led 1 on the embed
 
     /*Updates battery voltage*/
     batVol = m3pi.battery(); 
@@ -118,7 +114,7 @@
     /*Test if the voltage is below the treshold if so turn on go to pit mode*/
     if batteryVoltage <= BATVOLTRESHOLD (){  
         gotoPit = 1; // set goto pit condition
-        led1 = 1; // trun on Led 1
+        LED_Control(1,1); // turn on Led 1
         m3pi.cls();
         m3pi.locate(0,0);
         m3pi.printf("Going to");
@@ -129,6 +125,7 @@
 
 
 void LED_Control(int ledNumber, int state){
+    //LED1 on if robot is looking for pit
     if ledNumber == 1{
         DigitalOut led1(state);
     }