So, I tried powering two motors with the L298N motor driver and an Arduino MKR WiFi 1010 and I used a program that turns the motors on for 1 second, and off for one second etc.
But when I power up the Arduino to run the program, the motors do not turn off.
I tested it and it is very confusing, the motors and driver work, and the program works with leds, but not motors. Also, the program works if you only use one motor, but not two.
Please let me know if I am doing anything wrong. Here is some info about the motors and driver: the driver works and has worked with the Arduino before. The motors are nine volts and the hole thing is grounded properly.
I am new to Arduino so again thanks if you can help.
void setup() {
// put your setup code here, to run once:
pinMode(7,OUTPUT);
pinMode(6,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(7,HIGH);
digitalWrite(6,HIGH);
delay(1000);
digitalWrite(7,LOW);
digitalWrite(6,LOW);
delay(1000);
}
If the wiring is correct that code would not turn the motors on.
The two input to the motor drive chip have to be different logic levels to turn the motors on and the same level to turn the motors off.