Stepper Motor control with 1 limit switch

There is a similar tutorial: Arduino - stepper motor and limit switch