ok so what i want is for these two motors to work in turns… so one works for 5 seconds and the other one is off, and then they switch. we did this by adding delays in our code. it works on tinkercad but it doesnt work in real life. the motors dont seem to read the code as they dont delay and just keep going. why could this be? we checked our ardunio and everything- the code was uploaded properly.
heres the code:
void setup()
{
pinMode(13, OUTPUT);
pinMode(12,OUTPUT);
}
void loop()
{
digitalWrite(13, HIGH);
delay(5000); // Wait for 5000 millisecond(s)
digitalWrite(13, LOW);
digitalWrite(12,HIGH);
delay(5000); // Wait for 5000 millisecond(s)
digitalWrite(12,LOW);
}
attatched below is our circuit