stepper motor not working

Have you got the motor working properly with a simple program that make it go (say) 400 steps forward and backward?

If not, get that working first.

...R

PS ... To make it easy for people to help you please modify your post and use the code button </> so your code looks like this and is easy to copy to a text editor. See How to use the Forum