Is the Arduino GND connected to the L298 GND?
Yeah both. GND arduino conected to driver and when remove enA A Motor not spining.
Remove from Arduino and connect to GND, so that enA is connected to GND?
Not spining.
Maybe change it so that 5v is applied to the enA input and in2 is used for direction, when in2 is HIGH then in1 is the inverse PWN. Would this help in any way, how could it be done?
No it would not help.
The normal way to use the L289, is to use the IN1234 pins for direcion control and the ENAB pins for speed control using PWM.
I don't understand why the motor would spin if you had the PWM set to 0
Are you using an UNO?
I'm out of suggestions.
The code I gave you is the bare minimum to make the motors run.
If you set analogWrite(enA, 0); and motor A still runs, then I can't explain why.
@kemzansdinars
Try these connections
// Connections for Motor A
int enA = 11; // connect enA to pin 11
int in1 = 8; // connect IN1 to pin 8
int in2 = 7; // connect IN2 to pin 7
// Connections for Motor B
int enB = 10; // connect enB to pin 10
int in3 = 5; // connect IN3 to pin 5
int in4 = 4; // connect IN4 to pin 4
many thank @jim-p for the many suggestions. I found a problem. i had connected two pins in pairs, disconnected the further one and now i can change the speed of both motors.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.

