Hello,
I'm working on a simple circuit to control two DC motors using a L293D H Bridge.
Both motors will go forward. Only one will go backward.
Motor B will go forward and backward.
Motor A will only go forward.
My code and wiring looks good, to my eye. Not sure whats going on.
As I understand it, the L293D is essentially 4 half h bridges. Could it be one of these halves is dead? Is there a way to test this?
Code is pasted below. Wiring pics are attached.
I'm coping this tutorial.
http://blog.whatgeek.com.pt/2015/03/arduino-l293d-dc-motors-control/
Thanks.
int go_A = 5;
int A_1 = 6;
int A_2 = 7;
int go_B = 8;
int B_1 = 9;
int B_2 = 10;
void setup() {
Serial.begin(9600);
pinMode(go_A, OUTPUT);
pinMode(A_1, OUTPUT);
pinMode(A_2, OUTPUT);
pinMode(go_B, OUTPUT);
pinMode(B_1, OUTPUT);
pinMode(B_2, OUTPUT);
}
void loop() {
Serial.println("MOTORS GO!");
digitalWrite(go_A, HIGH);
digitalWrite(go_B, HIGH);
delay(1000);
Serial.println("MOTORS FOWARD!");
digitalWrite(A_1, LOW);
digitalWrite(A_2, HIGH);
digitalWrite(B_1, LOW);
digitalWrite(B_2, HIGH);
delay(3000);
//Serial.println("MOTORS BACKWARDS!");
digitalWrite(A_1, HIGH);
digitalWrite(A_2, LOW);
digitalWrite(B_1, HIGH);
digitalWrite(B_2, LOW);
delay(3000);
Serial.println("MOTORS STOP!");
digitalWrite(go_A, LOW);
digitalWrite(go_B, LOW);
delay(3000);
}