#define Enable 8
#define Pin_Direction 2
#define Pin_Step 5
int Motor_Speed = 2000; //stepper motor speed in Milliseconds
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(Enable, OUTPUT);
pinMode(Pin_Direction, OUTPUT);
pinMode(Pin_Step, OUTPUT);
digitalWrite(Enable, LOW);
digitalWrite(Pin_Direction,HIGH);
/* Use this code if no Push Button is NOT NEEDED */
for (int Current_Position = 0 ; Current_Position <= 3000 ; Current_Position++)
{
Serial.println(Current_Position);
digitalWrite(Pin_Step, HIGH);
delayMicroseconds(Motor_Speed);
digitalWrite(Pin_Step, LOW);
delayMicroseconds(Motor_Speed);
/* Use this code if no Push Button is NEEDED */
}
}
void loop()
{
// put your main code here, to run repeatedly:
}