Hello guys!
I'm new in arduino and I got a problem controlling my DC motors. I have my DC motors connected to a L298n Motor Driver powered by a 9V battery. The Motor Driver is connected to my arduino on digital pins 6, 7, 8 and 9. I wrote this program, verified it and uploaded it on my arduino but nothing happen my motors don't move a inch. I mention that my DC Motors have a supply voltage of 3-6V. What should be the problem?
Thank you in advance!
Program:
const int IN1=6;
const int IN2=7;
const int IN3=8;
const int IN4=9;
void setup() {
pinMode(IN1, OUTPUT);
pinMode(IN2,OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4,OUTPUT);
}
void loop() {
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}