arduino uno has 6 PWM pins and I want to control 4x DC motors with 2x L293ds.
So there are 8 pins that go to the input of the L293D from the arduino , 2 for each motor,
that leaves 2 pins not inserted into PWM pins , one might say that I could put those other two into digital pins and making PWM via those 2 pins , but is there any solution for this since I want to change directions and making vehicle turn left and right by changing polarity of the voltage to the motors.
MarkT:
4 pwm pins to the enables, 8 pins to control direction/on/off
Sorry but could you be more specific I didn't understand you.
Yes I need 8 pins since there are 4 enable pins on the every L293d but if I put only one PWM pin to each enable pin for every single motor I can PWM only one direction of the vehicle since left enable pins are connected to the digital pins.
PWM to the enable pins, there is one enable pin per H-bridge. This is how most everyone does it,
enable enables everything so it works whatever direction.
L293D has 2 enable pins per H-bridge so If I set one PWM pin to LOW to change the direction of the motor how am I supposed to give PWM signal to the chip when PWM pin is set to LOW , or am I totally wrong?