Datasheet

class Adafruit_StepperMotor
The Adafruit_StepperMotor class represents a stepper motor attached to the shield. You must declare an
Adafruit_StepperMotor for each stepper motor in your system.
Adafruit_StepperMotor(void);
The constructor takes no arguments. The stepper motor is typically initialized by assigning a stepper object retrieved
from the shield as below:
void step(uint16_t steps, uint8_t dir, uint8_t style = SINGLE);
The step() function controls stepper motion.
The first parameter specifies how many steps to move.
The second parameter specifies the direction: FORWARD or BACKWARD
The last parameter specifies the stepping style: SINGLE, DOUBLE, INTERLEAVED or MICROSTEP
The ste() function is synchronous and does not return until all steps are complete. When complete the motor remains
powered to apply "holding torque" to maintain position.
void setSpeed(uint16_t);
The setSpeed() function controls the speed of the stepper motor rotation. Speed is specified in RPM.
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myMotor = AFMS.getStepper(200, 2);
© Adafruit Industries https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino Page 37 of 43