Created
March 22, 2018 11:32
-
-
Save azhaganandhan/4d5a07de119c6c6586d0b73186bce341 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> | |
char incomingByte; | |
const int stepsPerRevolution = 2000; | |
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); | |
Stepper youStepper(stepsPerRevolution, 2, 3, 4, 5); | |
void setup() { | |
myStepper.setSpeed(800); | |
Serial.begin(9600); | |
} | |
void loop() { | |
if (Serial.available()) { | |
incomingByte = Serial.read(); | |
if(incomingByte == 'R') { | |
youStepper.step(stepsPerRevolution); | |
} | |
if(incomingByte == 'L') { | |
myStepper.step(stepsPerRevolution); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment