button to stop stepper

abhixs:
thanks for your help...yesterday i have done some R&D and written the very simple code to solve this problem :slight_smile:

Now that your code can find the switch, you may realize the stepper has actually moved a bit beyond where the switch was pressed.

Now add code to single step the motor back away from the switch until the switch turns off. Then your motor is at the proper stop point.

Paul