Created
January 11, 2020 10:37
-
-
Save SweiLz/e7957cdfe6369b020321ca8ba586cf69 to your computer and use it in GitHub Desktop.
This file contains 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 = 2048; | |
Stepper myStep = Stepper(stepsPerRevolution,8,10,9,11); | |
void setup() { | |
myStep.setSpeed(15); // speed in rpm | |
Serial.begin(9600); | |
} | |
void loop() { | |
Serial.println("clockwise"); | |
myStep.step(stepsPerRevolution); | |
delay(500); | |
Serial.println("counterclockwise"); | |
myStep.step(-stepsPerRevolution); | |
delay(500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment