Stepper driver steps not accurate

Robin2:
I just tried it now and it works fine. Every time I ground the wire in pin2 it moves my motor 400 steps.

...R

Weird, I tried it again and it didn't work but I copy and pasted what you had and it did, I still can't see what I had wrong and I have them side by side on the screen.

Thanks for the help, I thought it should have worked like the old code but just couldn't figure out where I was wrong.