// Forum: https://forum.arduino.cc/t/turning-motor-in-one-direction/1110192
#define stepPin 5
#define dirPin 2
void setup() {
Serial.begin(115200);
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
}
void loop() {
Serial.println("Making another 800 steps");
digitalWrite(dirPin, HIGH); //sets which direction shaft rotates
//makes 800 pulses for making 4 revolutions
for (int x = 0; x < 800; x++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(37500 );
digitalWrite(stepPin, LOW);
delayMicroseconds(37500);
}
delay(2000);
}