#define stepPin 2
#define dirPin 5
#define left 11
#define right 12 //War Does Not Determine Who Is Right — Only Who Is Left
void setup() {
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
pinMode(left, INPUT);
pinMode(right, INPUT);
}
void loop() {
while(digitalRead(left)==LOW){
digitalWrite(dirPin, LOW);
digitalWrite(stepPin,HIGH);
delayMicroseconds(700);
digitalWrite(stepPin,LOW);
delayMicroseconds(700);
}
while(digitalRead(right)==LOW){
digitalWrite(dirPin, HIGH);
digitalWrite(stepPin,HIGH);
delayMicroseconds(700);
digitalWrite(stepPin,LOW);
delayMicroseconds(700);
}
}