L298N Motor driver module is not seeming to work and i dont know why anymore.
int const ENB=13;
int const ENA=9;
int const In4=12;
int const In3=11;
int const In1=7;
int const In2=8;
void setup() {
// put your setup code here, to run once:
pinMode(ENB,OUTPUT);
pinMode(In4,OUTPUT);
pinMode(In3,OUTPUT);
pinMode(ENA,OUTPUT);
pinMode(In2,OUTPUT);
pinMode(In1,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(In3,HIGH);
digitalWrite(In4,LOW);
digitalWrite(In1,HIGH);
digitalWrite(In2,LOW);
analogWrite(ENB,180);
analogWrite(ENA,180);
delay(1000);
digitalWrite(In4,HIGH);
digitalWrite(In3,LOW);
digitalWrite(In2,HIGH);
digitalWrite(In1,LOW);
analogWrite(ENA,180);
analogWrite(ENB,180);
delay(1000);
}
I do not know why at all and i used a different board but broke BUT IT DID WORK. Its hooked up through the programming port plus a extra 3V of batt since my friend broke my other 5V pack and didn't replace it but its a secondary at the moment.
Pookiloo:
I do not know why at all and i used a different board but broke BUT IT DID WORK. Its hooked up through the programming port plus a extra 3V of batt since my friend broke my other 5V pack and didn't replace it but its a secondary at the moment.
Time to make a wiring diagram of what exactly you have and how you have it wired together. Can we guess your "programming port" is the computer's USB connection?
It is a USB. I appreciate your help but I would rather less sass. Sorry. I don't mind if your not meaning it but I'm asking for help so I know I am an idiot but I don't need someone else to treat me like that.
Pookiloo:
It is a USB. I appreciate your help but I would rather less sass. Sorry. I don't mind if your not meaning it but I'm asking for help so I know I am an idiot but I don't need someone else to treat me like that.
When someone writes "driver module is not seeming to work and i dont know why anymore.". What am I to think?
If English is not your native language, then you are forgiven.
I see you are using the Arduino pin d13, which is used by the microcontroller to control the LED on the board. Can you puck another pin to use as the enable?
int const ENB=6;
int const ENA=9;
int const In4=12;
int const In3=11;
int const In1=7;
int const In2=8;
void setup() {
// put your setup code here, to run once:
pinMode(ENB,OUTPUT);
pinMode(In4,OUTPUT);
pinMode(In3,OUTPUT);
pinMode(ENA,OUTPUT);
pinMode(In2,OUTPUT);
pinMode(In1,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(In3,HIGH);
digitalWrite(In4,LOW);
digitalWrite(In1,HIGH);
digitalWrite(In2,LOW);
analogWrite(ENB,180);
analogWrite(ENA,180);
delay(1000);
digitalWrite(In4,HIGH);
digitalWrite(In3,LOW);
digitalWrite(In2,HIGH);
digitalWrite(In1,LOW);
analogWrite(ENA,180);
analogWrite(ENB,180);
delay(1000);
}
Also Im running a Ultrasonic Sensor on it so some ports are taken up (4).
Sorry it was just an image of the Motor driver cause im blind and so you knew what i was referring to
I dont have it hooked up across the ground i have it hook on a breadboard side bar but only the 2 connecting wires cause I dont have long enough wires since i have it on a chassis that but the ENB is now on 5 since I tried swapping it off of 13