Created
May 2, 2014 00:02
-
-
Save andysmithfal/37939fa6df8f03ead43f to your computer and use it in GitHub Desktop.
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
#include <Stepper.h> | |
const int stepsPerRevolution = 2050; | |
Stepper myStepper(stepsPerRevolution, 2, 3, 4, 5); | |
void setup() { | |
myStepper.setSpeed(5); | |
} | |
void loop() { | |
//do a full 360 and stop - using the stepsPerRevolution value set above | |
myStepper.step(stepsPerRevolution); | |
delay(1000); | |
//do 180 degrees | |
myStepper.step(stepsPerRevolution/2); | |
delay(1000); | |
//move an arbitrary amount of steps | |
myStepper.step(500); | |
delay(1000); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment