Hello everybody,
I'm trying to build a quadcopter based on Arduino Pro Mini with atmega328p using the popular RF module based on VirtualWire library. For this project I need to control 4 motors by 4 PWM pins.
I have 2 problems:
- Searching on Google and Arduino forum I found that VirtualWire library uses a Timer, hindering the correct use of pins 9 and 10 with analogWrite function, because the same timer is used to set the PWM on these two pins.
- PWM on pins 5 and 6 uses a frequency which is greater than the one used in other pins. This seems to make the motors on these pins go slower somehow.
Which solution would you suggest?
I could control the four motors by pins 3, 5, 6, 11 but first I should make pins 5 and 6 work at the same frequency of other pins. Searching on Google it doesn't seem possible, is it?
Otherwise I could hack the VirtualWire library to use the timer needed for PWM on pins 5 and 6, instead of the one needed for pin 9 and 10, so i could use them for controlling motors. Is it possible without compromising the VirtualWire library operations?
Thanks a lot to whoever will give me any good suggestion