Adafruit - THE MUSICAL - is here! Get a musical tour of Becky's favorite tools around the Adafruit factory (video) and subscribe!

Motor Shield on the Arduino MEGA 2560
Moderators: adafruit_support_bill, adafruit

Re: Motor Shield on the Arduino MEGA 2560

by adafruit_support_bill on Thu Dec 06, 2012 9:10 am

I tested this on a Mega and it does work using the PWM frequencies for motors 3 & 4. You must use the "MOTOR34_xxKHz" constants for motors 3 & 4, not the "MOTOR12_xxKHZ" constants.
Code: Select all | TOGGLE FULL SIZE
    #define MOTOR34_64KHZ _BV(CS00) // no prescale
    #define MOTOR34_8KHZ _BV(CS01) // divide by 8
    #define MOTOR34_1KHZ _BV(CS01) | _BV(CS00) // divide by 64
User avatar
Posts: 32596
Joined: Sat Feb 07, 2009 10:11 am