Created
November 26, 2013 19:33
-
-
Save Mango-kid/7664679 to your computer and use it in GitHub Desktop.
This program will drive a 2 phase (4 wire) bipolar stepper motor
with the RB-MD.3.0.1 luachpad booster pack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This program will drive a 2 phase (4 wire) bipolar stepper motor | |
with the RB-MD.3.0.1 luachpad booster pack | |
*/ | |
#include <Stepper.h> | |
const int stepsToTravel = 200; | |
// setup stepper motor on correct pins to match the RB-MD.3.0.1 | |
Stepper myStepper(stepsPerRevolution, 9,10,12,13); | |
void setup() { | |
myStepper.setSpeed(60); | |
} | |
void loop() { | |
// rotate the stepper in one direct | |
myStepper.step(stepsToTravel); | |
delay(500); | |
// rotate in the oposite direction | |
myStepper.step(-stepsToTravel); | |
delay(500); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment