Thanks for your question. Skip to the bottom if you just want an answer to try. If you're interested in details read on, it's kind of deep, but also highlights the flexibility of the motor shield, which is kind of cool.
I think it's not a problem with the Motor Shield, per se. It's an interaction of capabilities of the ATmega328p fundamentally. Your IR library takes over TIMER2. This picture is from the Arduino website:
Wherever you see OC2x there it's tightly coupled (in hardware) to TIMER2 behavior. Those are the DIG3 and DIG11 PWM outputs respectively. From the Motor Shield User's Guide you can find this table:
So in the default position, J1 causes DIG11 to control M1, and J2 causes DIG3 to control M6. So the question is what happens when you do m[0]->setSpeed(). The function that ultimately gets called by doing that is here. And assuming you have set m[0] up like in the DC_Motor example here, that executes this line of code. And that amounts to (for M1 in the default jumper configuration): analogWrite(11, value);
.
To understand what happens next you have to dive into the Arduino core and see what analogWrite does. You can find that here, but the key point is that it messes with TIMER2.
PROPOSED SOLUTION
So after all that, I think the way to solve your problem is to:
- move J1 to the "up" position so that DIG8 controls M1's speed instead of DIG11.
- add the following line of code to your sketch's setup to override the default and make software consistent with your 'hybrid' jumper configuration:
WickedMotorShield::M1_PWM_PIN = 8;
That should do it. I think.