I am trying to control two motors and three servos using an arduino nano. When I hook up the motors using the pwm pins everything works great. When I add the line to my setup function: "myservo.attach(2) " I lose the ability to use PWM for one of my motors.
I am using pins 5,6,9,10 to control two motors bi-directionally using an L293 Driver so there is no concern with current draw. The servo is being powered using a 7805 voltage regulator from my supply. I can control the servo just fine, but lose my PWM control when I enable it.
Yes that will happen because the servo library uses the same timer as those two pins. Nothing you can do about it I am afraid apart from using a bigger system line a Mega.
So to clarify, the Uno is capable of 6 PWM outputs, but when using servos, each servo consumes 2 PWM pins. Therefore the Uno would not be compatible and I would need a MEGA?
So Changing from Pins 9&10 to 3&11 would fix the problem and enable me to use PWM for my motor controls as well as enable me to control servos as well?
I could attach servos to Pins 2,4,7 and make this work?