Arduino Leonardo with Motor Shield and 4-wire stepper motor

Parts used

img

img

img

img

#include  const int stepsPerRevolution = 200; const int pwmA = 3; const int pwmB = 9; const int dirA = 2; const int dirB = 8; Stepper myStepper(stepsPerRevolution, dirA, dirB); void setup() {  pinMode(pwmA, OUTPUT);  pinMode(pwmB, OUTPUT);  digitalWrite(pwmA, HIGH);  digitalWrite(pwmB, HIGH);  myStepper.setSpeed(100); } void loop() {  myStepper.step(stepsPerRevolution);  delay(1000); }