arduino program 3d printer

but it's not working

What should it do ?
What does it do ?

Why didn't you Auto Format the code before posting it ?
Why didn't you use code tags when posting it ?
Why do you have a while(1) loop inside the loop() function ?