// defines pins
// #define stepPin 2
// #define dirPin 5
int stepPin = 2;
int dirPin = 5;
void setup() {
// Sets the two pins as Outputs
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
//digitalWrite(dirPin, LOW); // Enables the motor to move in a particular direction
}
void loop() {
// digitalWrite(dirPin, HIGH); // Enables the motor to move in a particular direction
// Makes 200 pulses for making one full cycle rotation
digitalWrite(dirPin, HIGH); // Enables the motor to move in a particular direction
digitalWrite(stepPin, HIGH);
delayMicroseconds(700); // by changing this time delay between the steps we can change the rotation speed
digitalWrite(stepPin, LOW);
delayMicroseconds(700);
}