#include <AFMotor.h> // Motor with 200 steps per rev (1.8 degree) // to motor port #1 (M1 and M2) AF_Stepper motor_2(200, 2); AF_Stepper motor_1(200, 1); void setup() { // set up Serial library at 9600 bps Serial.begin(9600); Serial.println("Stepper test!"); motor_1.setSpeed(400); // 50 rpm motor_2.setSpeed(400); // 50 rpm } void loop() { Serial.println("Micrsostep steps"); motor_1.step(50, FORWARD, MICROSTEP); motor_2.step(50, FORWARD, MICROSTEP); motor_1.step(50, BACKWARD, MICROSTEP); motor_2.step(50, BACKWARD, MICROSTEP); motor_1.step(100, FORWARD, MICROSTEP); motor_2.step(100, FORWARD, MICROSTEP); motor_1.step(100, BACKWARD, MICROSTEP); motor_2.step(100, BACKWARD, MICROSTEP); motor_1.step(200, FORWARD, MICROSTEP); motor_2.step(200, FORWARD, MICROSTEP); motor_1.step(200, BACKWARD, MICROSTEP); motor_2.step(200, BACKWARD, MICROSTEP); motor_1.step(250, FORWARD, MICROSTEP); motor_2.step(250, FORWARD, MICROSTEP); motor_1.step(250, BACKWARD, MICROSTEP); motor_2.step(250, BACKWARD, MICROSTEP); }