Why my ''else if'' statement it's not working..Thanks!
if (volts > 150) {condition = 1;}
else {condition = 2;}
if (linesensor_left < kWhiteThreshold) {condition = 3;}
else if (linesensor_left < kWhiteThreshold && volts > 150) {condition = 1;}
if (linesensor_right < kWhiteThreshold){condition = 4;}
else if (linesensor_l < kWhiteThreshold && volts > 150) {condition = 1;}
switch (condition){
case 1:
go(200,200);
Serial.println("MERGI in fata");
break;
case 2:
go(70,-70);
Serial.println("MERGI intr-o parte");
break;
case 3:
go(-70,70);
delay(1500);
Serial.println("senzor linie stanga atins");
break;
case 4:
go(70,-70);
delay(1500);
Serial.println("senzor linie dreapta atins");
break;
}
}