Datasheet

// On the top shield, connect two steppers, each with 200 steps
Adafruit_StepperMotor *myStepper2 = AFMStop.getStepper(200, 1);
Adafruit_StepperMotor *myStepper3 = AFMStop.getStepper(200, 2);
// On the bottom shield connect a stepper to port M3/M4 with 200 steps
Adafruit_StepperMotor *myStepper1 = AFMSbot.getStepper(200, 2);
// And a DC Motor to port M1
Adafruit_DCMotor *myMotor1 = AFMSbot.getMotor(1);
You can request a stepper or DC motor from any port, just be sure to use the right AFMS controller object when you
call getMotor or getStepper!
Then, both shields must have begin called, before you use the motors connected
AFMSbot.begin(); // Start the bottom shield
AFMStop.begin(); // Start the top shield
You can try out this code for yourself by setting up two shields and running the File->Examples-
>Adafruit_MotorShield->StackingTest example
© Adafruit Industries https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino Page 42 of 43