je souhaite contrôler un nema 17, (sur un socle rotatif, et avec une uno), lorsque le moteur tourne dans un sens et qu'il arrive en butté du end-stop et bien qu'il tourne dans l'autre sens puis pareil pour le sens.
Je suis débutant,
merci pour votre compréhension,
// Include the Arduino Stepper Library
#include <Stepper.h>
// Number of steps per output rotation
const int stepsPerRevolution = 200;
// Create Instance of Stepper library
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
void setup()
{
// set the speed at 60 rpm:
myStepper.setSpeed(10);
// initialize the serial port:
Serial.begin(9600);
}
void loop()
{
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(50);
delay(900);
// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-50);
delay(900);
}
and there is much discussion you might benefit from.
Does the program you posted above operate the stepper motor?
It looks like it would turn 90 degrees one way, pause then turn 90 degrees the other way.
Have you written any programs at all? If not, you should just start with buttons and LEDs and the examples in the IDE, very easy and basic things you will need to know.
If you have written some more advanced programs, even a little bit, you should be able to get something working, we can help with your efforts.
But first describe as best you can the overall goal of the current experiment or project that you are working on. Just in plain terms (English, haha) what the program is supposed to do, and what inputs or other information is going to control the stepper motor.