PWM-ENABLE driver motor not working for 2 motors?

Thread Starter

Nagbbaba Khasakali

Joined Feb 9, 2015
2
So i have an L298N dual H bridge motor driver, which can drive 2 motors at max.

What do I want to achieve? control the speeds of each motor separately. Google suggests I connect each enable pin from the driver to a PWM pin on my Arduino board (UNO R3). IT WORKS for ONE (1) motor. But when I use TWO (2) motors and try to control the speeds separately like so:

analogWrite(ENALEFT, 255); // 100% speed
analogWrite(ENARIGHT, 125); // 50% speed

it doesn't work....
 

Thread Starter

Nagbbaba Khasakali

Joined Feb 9, 2015
2
well to show the previous breadboard wirings... here it is (attached below).

I however resorted to using PWMs for all the motor terminals and disconnected the driver enable pins from the arduino board. It now works.
 

Attachments

Top