#include <Stepper.h>
// Number of steps per output rotation
const int stepsPerRevolution = 800; // 90 degre
// Create Instance of Stepper library
// Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); // uno
// Stepper stepperRotator(stepsPerRevolution, 14, 15, 16, 17); // mega
Stepper stepperRotator(stepsPerRevolution, 17, 16, 15, 14); // mega
void setup() {
// set the speed at 60 rpm:
stepperRotator.setSpeed(10);
// initialize the serial port:
Serial.begin(115200);
}
void loop() {
stepperRotator.step(-stepsPerRevolution);
delay(1000);
}