I am trying to control a single DC motor using a L298N DC Motor Driver. I have a 12V motor plugged into Out1 and Out2, a 7.4 volt battery wired to the 12v in and common ground, a m/m common ground going from the arduino grnd to the L298N common ground, and I have IN1 and IN2 connected to digital pins 2 and 3. I am powering the Uno with USB. I am also running a m/m wire from the Uno 5v to the L298N (I shouldn't have to) in order to power the L298N
I am using a basic code to test the motor
> int motor1pin1 = 2;
> int motor1pin2 = 3;
>
> void setup() {
> pinMode(motor1pin1, OUTPUT);
> pinMode(motor1pin2, OUTPUT);
>
> }
>
> void loop() {
> digitalWrite(motor1pin1, HIGH);
> digitalWrite(motor1pin2, LOW);
>
> delay(1000);
>
> digitalWrite(motor1pin1, LOW);
> digitalWrite(motor1pin2, HIGH);
>
> delay(1000);
> }
If I wire the 7.4v lipo battery directly to the L298N the red led doesn't go on. It only goes on when I run a 5V wire from the Uno to the L298N. Yet still I get no reaction out of the motor. However if I run a ground from the arduino directly to the out1 or out2, the motor turns in that one direction. Anyone have an idea what I am doing wrong?