Arduino code not working the way it should

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);
}

 

It will work fine if you set
It will work fine if you set the other 2 pins LOW in driveforward() and reverse() functions. Now you have just the pins that are set HIGH in those functions. Look at the stopmot() function and make sure you have all 4 lines in all functions, but with the pins set accordingly.

oh
cool ill try that now ,thanks

it works!!!
hurrray it works thanks

K243 motor controller with arduino

Hello Dimble,

 

Is this the code you used to drive the K243? Forward, stop, and reverse?

 

Hope for your reply.

ferari

um

nope this is for my arduino start here robot