This appears thaty the dc motor is meant to go one way then reverse for the other way but only seem to get it to turn one way then have big pauses. Any idea why... Eleego most complete starter kit Lesson 30 Relays
//www.elegoo.com
//2016.12.12
/************************
Exercise the motor using
the L293D chip
************************/
#define ENABLE 5
#define DIRA 3
#define DIRB 4
int i;
void setup() {
//---set pin direction
pinMode(ENABLE,OUTPUT);
pinMode(DIRA,OUTPUT);
pinMode(DIRB,OUTPUT);
Serial.begin(9600);
}
void loop() {
//---back and forth example
Serial.println("One way, then reverse");
digitalWrite(ENABLE,HIGH); // enable on
for (i=0;i<5;i++) {
digitalWrite(DIRA,HIGH); //one way
digitalWrite(DIRB,LOW);
delay(750);
digitalWrite(DIRA,LOW); //reverse
digitalWrite(DIRB,HIGH);
delay(750);
digitalWrite(ENABLE,LOW); // disable
delay(3000);
for (i=0;i<5;i++) {
digitalWrite(DIRA,HIGH); //one way
digitalWrite(DIRB,LOW);
delay(750);
digitalWrite(DIRA,LOW); //reverse
digitalWrite(DIRB,HIGH);
delay(750);
}
digitalWrite(ENABLE,LOW); // disable
delay(3000);
}
}