Trying to Use a limit switch to change the direction of rotation of Stepper motor

Is this a school project? This is the third time this question is posted.
Please read and use the topic How to get the best out of this forum - Using Arduino / Project Guidance - Arduino Forum

and provide schematics for the build, links to datasheets, tell which of the 20 different Arduinos You use.