Arduino + Unipolar Stepper Motor




Arduino Code (Back & Forth)

#include <Stepper.h>
#define STEPS 400 //360° divided by step angle

Stepper stepper(STEPS, 8, 9);

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

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


Arduino Code (Back & Forth)

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

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

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

No comments:

Post a Comment