Grumpy_Mike:
Well without the context of the schematic it is hard to say much.
What I can say is that this sketch sets some lines to one state and then does nothing about changing those states, in other words once set up it does nothing. s that what you want?
Why are your pins called input1 etc.. when they are clearly outputs? Variable name should reflect what is happening to avoid confusion.
Opps. Sorry kinda missed that, I got the fact that they are inputs in my head but not for the variable name.
Heres the revision with more info:
int output1 = 5;
int output2 = 7;
int enableA = 6;
int output3 = 10;
int output4 = 12;
int enableB = 11;
void setup() {
pinMode(output, OUTPUT);
pinMode(output2, OUTPUT);
pinMode(enableA, OUTPUT);
pinMode(output3, OUTPUT);
pinMode(output4, OUTPUT);
pinMode(enableB, OUTPUT);
analogWrite(enableA,255);
analogWrite(enableB,255);
}
void loop() {
digitalWrite(enableA, HIGH);
digitalWrite(enableB, HIGH);
digitalWrite(output1, LOW);
digitalWrite(output2, HIGH);
digitalWrite(output3, LOW);
digitalWrite(output4, HIGH);
delay (2000);
}
How it is connected:
Arduino : L298n
Digital 5 to Input1 (pin 5)
Digital 7 to Input2 (pin 7)
Digital 6 to EnableA (pin6)
Digital 10 to Input3 (pin 10)
Digital 12 to Input4 (pin 12)
Digital 11 to EnableB (pin11)
5v to logic supply (pin 9)
Gnd of Arduino to battery negative side to Gnd of l298n (pin 8 )
Output1 and 2 (l298n) to DC motor 1
Output3 and 4 (l298n) to DC motor 2
I am quite certain that I have wired everything up correctly but for some reason only motor 2 runs when it runs through my program. Output1 and 2 can never run motor 1. Does this mean I have fried my l298n? I am using 2 D cell batteries for the power supply (3v stacked together). These are the same batteries used for running these motors in the original kit before any modification. I am modifying this kit for my project : http://www.tamiyausa.com/product/item.php?product-id=70107 I have checked for any loose wires and made sure the l298n have all the pins contacting the breadboard but no luck. As a side note, I have tried changing up the wiring and can confirm that the motors do work and the arduino was not damaged, so does this really mean the l298n was damaged?
Its not even about that the l298n cannot run 2 motors concurrently anymore, Output1 and 2 cannot drive a motor no matter what I try.