Ok, I finally picked up two Photo Interrupters. One will be mounted on one end of the stepper motorised slide rail and the other sensor will be mounted on the other end.
Can anyone point to a tutorial or a piece of code will serve this purpose. Actual process flow noted below:
- Press a button
- Motor turns on and the slide rail starts to move backwards and will come to a complete stop once the photo interrupter’s light is impeded and the power will be cut automatically
- Press button
- Motor turns on and the slide rail starts to move forwards and will come to a complete stop once the photo interrupter’s light is impeded and the power will be cut automatically
Thanks again for all your help.