// Stepper motor on Wokwi!
#include <Stepper.h>
const int stepsPerRevolution = 245; // change this to fit the number of steps per revolution for your motor
const int pos_secondo = 15;
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(200);
// initialize the serial port:
Serial.begin(9600);
// Calculate steps per second
int stepsPerSecond = stepsPerRevolution / 60;
// Calculate the number of steps to reach the 17th second
int stepsToSecond = stepsPerSecond * pos_secondo;
// Move the stepper to the desired position
myStepper.step(stepsToSecond);
}
void loop() {
// Nothing to do in loop for this task
}