Datasheet

Using Stepper Motors
Stepper motors are great for (semi-)precise control, perfect for many robot and CNC projects. This motor shield
supports up to 2 stepper motors. The library works identically for bi-polar and uni-polar motors
For unipolar motors: to connect up the stepper, first figure out which pins connected to which coil, and which pins are
the center taps. If its a 5-wire motor then there will be 1 that is the center tap for both coils. Theres plenty of tutorials
online on how to reverse engineer the coils pinout. The center taps should both be connected together to the GND
terminal on the motor shield output block. then coil 1 should connect to one motor port (say M1 or M3) and coil 2 should
connect to the other motor port (M2 or M4).
For bipolar motors: its just like unipolar motors except theres no 5th wire to connect to ground. The code is exactly the
same.
Running a stepper is a little more intricate than running a DC motor but its still very easy
Include the required libraries
Make sure you #include the required libraries
Create the Adafruit_MotorShield object
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
© Adafruit Industries https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino Page 32 of 43