i just made a motor driver circuit on a veroboard to use with my arduino but the problem is l298 spinning motor only one way. here is the code it was supposed to spin motor forth and backwards every 2 seconds right?
int mot1ana=5;
int mot1a=6;
int mot1b=7;
void setup() {
pinMode(mot1ana,OUTPUT);
pinMode(mot1a,OUTPUT);
pinMode(mot1b,OUTPUT);
}
void loop() {
analogWrite(mot1ana,200);
digitalWrite(mot1a,HIGH);
digitalWrite(mot1b,LOW);
delay(2000);
analogWrite(mot1ana,200);
digitalWrite(mot1a,LOW);
digitalWrite(mot1b,HIGH);
delay(2000);
}