Stepper Motor control with 1 limit switch

Please show a picture of your setup and your sketch as it looks so far.
Is it the same switch that is closed at the beginning and end of the movement?