Arduino + Bipolar Stepper Motor





Arduino Code (Back & Forth)


#include <Stepper.h>
#define STEPS 200 //360° divided by step angle
Stepper stepper(STEPS, 9, 10, 11, 12);

void setup(){
stepper.setSpeed(30); //RPMs
}

void loop(){
stepper.step(100);
delay(100);
stepper.step(-100);
delay(100);
}




No comments:

Post a Comment