motor driver pulse confusion .

i though this was an electrical problem , but i verified everything and all seems to be just fine .
i am using an a4988 stepper motor driver , it has a “step” pin , the datasheet specifies that a low to high transition on that pin leads to a single step .

void setup(void){
  pinMode(2,1);
  pinMode(3,1);
  pinMode(6,1);
  pinMode(7,1);

  digitalWrite(2,1); //dir
  digitalWrite(6,0); //en
  digitalWrite(7,1);
  digitalWrite(3,0);
}
void loop(void){
  
  
  
  for(uint16_t x=0;x<200;x++) {
                           digitalWrite(3,1); delayMicroseconds(500); digitalWrite(3,0);  
/* second delay*/delayMicroseconds(500);
  }
  delay(5000);
  
  
  }

i used that simple program to test everything , the motor has an 1.8deg step , so 200 steps must do a 360deg rotation . that program works fine as it does a 360 every 5 seconds .
the problem is : when i augment the second delay (since in my real application it’s alot more than 500us)
i changed the function to delay() and started testing . with 1ms the motor does a slightly smaller turn (less than 360degrees) so it does not return to it’s initial position every 5 seconds . when agumented 1 , 10 , 20 , 30 … 50 , … 100ms the turn is smaller and smaller every time . according to the Datasheet this makes no sense .

thank you very much for your attention .

Thank you for using code tags when posting your code, but is it really as badly laid out as that ? What's with the 16 blank lines at the start of it ?

UKHeliBob: Thank you for using code tags when posting your code, but is it really as badly laid out as that ? What's with the 16 blank lines at the start of it ?

i am sorry for that , i copied it as it is . i erased a longer program and wrote that one .