A4988 Stepper Driver

Hello,

I’am new on Arduino programming and I need your friendly Help. I wan’t replace the delay’s from this Code with millis, how go’s on ? I tried it to replace with millis in many hours on work and dont works. Here is the Code :

const int stepPin = 3;
const int dirPin = 4;

void setup() {
// Sets the two pins as Outputs
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
}
void loop() {
digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
// Makes 200 pulses for making one full cycle rotation
for(int x = 0; x < 200; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(1000); // One second delay
}

Have a look at the second example in this Simple Stepper Code

...R Stepper Motor Basics