hello, i have to program a car to avoid obstacles but as i am very new to the programming world, i have a few problems.
- my car refuses to turn left or right when placed on the floor.
i am using 4 metal gear motors (6V 33.5 220RPM) connected to an l298 H bridge.
my power supply is 6v (not sure if i require higher)
to turn left the code is below;
void left(int turntime)
{
analogWrite(ENA,200);
analogWrite(ENB,200);
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
digitalWrite(in3,HIGH);
digitalWrite(in4,LOW);
Serial.println("go left!");
delay(turntime);
}
the motors keep on stalling, how do i overcome this please and thank you.