i made a code ,and the code doesnt work the way it should, it makes the motors go bakwards ,pause, backwards
this isnt what i told it to do, why is this so here is the code , hope you can help cause i want to enter this in the arduino challenge
void setup(){
Serial.begin(9600);
pinMode(13,OUTPUT);
pinMode(12,OUTPUT);
pinMode (11,OUTPUT);
pinMode (10,OUTPUT);
}
void loop()
{
driveforward();
delay(1000);
stopmot();
delay (1000) ;
reverse();
delay(1000);
return;
}
void driveforward()
{ digitalWrite(12,HIGH);
digitalWrite(10,HIGH);
}
void stopmot()
{
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
}
void reverse()
{
digitalWrite(13,HIGH);
digitalWrite(11,HIGH);
}