const int dirPin = 2;
const int stepPin = 3;
const int stepsPerRevolution = 400;
void setup() {
// put your setup code here, to run once:
pinMode(dirPin, INPUT_PULLUP);
pinMode(stepPin, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(dirPin, HIGH);
for(int x= 0; x < stepsPerRevolution; x++)
{
digitalWrite(stepPin, LOW);
delayMicroseconds(4000);
digitalWrite(stepPin, HIGH);
delayMicroseconds(4000);
}
delay(1000);
// put your main code here, to run repeatedly:
// digitalWrite(dirPin, LOW);
// for(int x= 0; x < stepsPerRevolution; x++)
// {
// digitalWrite(stepPin, LOW);
// delayMicroseconds(2000);
// digitalWrite(stepPin, HIGH);
// delayMicroseconds(2000);
// }
// delay(1000);
}