I have an Arduino and a step motor, this is my code :
#include <Stepper.h>
// Définir le nombre de pas par tour
int NbrPas = 200;
Stepper MonMoteur(NbrPas, 8, 9, 10, 11);
void setup() {
// Vitesse à 60 tours/min
MonMoteur.setSpeed(60);
Serial.begin(9600);
}
void loop() {
// Faire un tour dans un sens
Serial.println("Sens 1");
MonMoteur.step(NbrPas);
delay(500);
}
It's for 1 round, I would like to know how to make several rounds with my step motor
If you want to make several rounds, firstly you have to change the value of NbrPas setting the number of steps per revolution suited to your needs. In your case you must set
int NbrPas = 2048;.Another piece of advice I can give you is to put an adequate value to
MonMoteur.setSpeed();. In 28BYJ-48 stepper motors the range is 0~17 rpm.I think this code is fine for your case