Pololu MC33926 Shield and servo motor conflict

What a joke.
I am a beginner who wanted to build a 4WD robot using an Arduino UNO R3, a few DC motors, a servo motor and a ultrasonic sensor.

Since I wanted a 4WD robot I got some nice DC motors from servocity (127rpm) and I also got a very nice motor driver shield from pololu (MC33926 shield).

I tested all parts separately (one sketch for each robot key feature), the motor driver has no issues with two motors in each channel, the ultrasonic sensor was giving me the distances from left, front and right using a servo motor attached to pin 6 (yes PIN 6 because PIN 9 is used by the motor driver shield) but when I combined all the stuff together….bannnnggggg…after attaching the servo motor to pin 6 the 4 DC motors don't move….1 hour later after debugging and blaming every single part of the hardware I realized that the problem was the servo library.

I know pololu MC33926 Shield allows for PIN remapping and I understand how to do the hardware part => cut the connection from the underside of the board as indicated in their webiste and solder pins to run wires to new PINs. The main problem I have is that this also requires changes to the library because I need the pololu library stop using PINs 9 and 10 to control motor speeds because the servo library turns off PWM on these PINs. For what I understand the process of changing the library is not as easy as to replace PIN 9 and 10 with PINs 3 and 5 for reasons that I still don't understand (researching).

The other solution I believe is to use an Arduino Mega board for which the servo library does not affect PWM signal in PINs 9 and 10, is this correct?

Regards

That's the price of plug-n-play and the reason I don't like, and never use shields. You could unplug the shield and connect to UNO using jumper wires and other PWM pins, but no PNP. >:(
0J4011.293.jpg

0J4011.293.jpg

The other solution I believe is to use an Arduino Mega board for which the servo library does not affect PWM signal in PINs 9 and 10, is this correct?

Yes, that's correct if you use only one servo (timer 5 will be used).

The Servo library uses timer 1 to generate it's signals. The same timer is used to generate the PWM signals on pins 9 and 10. The PWM of pins 3 and 11 are still available if you use the Servo library on the UNO (timer 2).

Thanks for all your replies

I am going to try using the ServoTimer2 library. It seems like it might work with my current setup.

JCA34F:
That's the price of plug-n-play and the reason I don't like, and never use shields.

Lesson learned....

JCA34F:
You could unplug the shield and connect to UNO using jumper wires and other PWM pins, but no PNP. >:(

I am sorry. I don't understand what you mean with no PNP. I am researching PWM to understand your point.

PNP -> plug 'n' play.

Vs using jumper wires to connect only the needed pins from board to board.

CrossRoads:
PNP -> plug 'n' play.

Vs using jumper wires to connect only the needed pins from board to board.

Thanks for the clarification. This my second option after ServoTimer2.