We should consider making pololu/dual-vnh5019-motor-shield a dependency, and this library as a shim (I think that's the right term) for the additional functions
The setM4Speed() and setM4Brake functions are currently trying to use OCR5B, which is the same one motor 3 is trying to use.
If motor 4 is on Pin 46, then the motor 4 functions should be using OCR5A.
Just trying to understand the code a bit more and looks like you have PWM1 and PWM2 pins listed as default 9, 10 in DualVNH5019MotorShieldMod3.cpp but later reference them to Timer 1 in comments and README however aren't they associated with Timer 2 for the Mega?
Also, wondering if I can use pins 44, and 45 by declaring those pins for PWM3 and PWM4 when constructing the object without issue as they are on the same timer. Or would I have to edit other parts? The reason is I am using the sensor shield (v2) and 44 and 45 make for easier cabling as opposed to 45 and 46
Thanks for the library
On the Arduino Mega we have 6 timers and 15 PWM outputs:
Pins 4 and 13: controlled by Timer0
Pins 11 and 12: controlled by Timer1
Pins 9 and10: controlled by Timer2
Pin 2, 3 and 5: controlled by timer 3
Pin 6, 7 and 8: controlled by timer 4
Pin 46, 45 and 44:: controlled by timer 5