Hi I hope I'm in the right forum/category. apologies if not.
I am working on a project for my local railway club to make a stepper motor driven turntable controlled by an Arduino.
the motor when powered up needs to auto home to the initial straight through track, then have the ability to turn a given point in this example 180' left of home when a button is pressed or 90' left of home if a different button is pressed.
i am assuming the motor needs to find a starting point point each time it is turned on to then go back to the home position ready for the first button press.
I can control my stepper left and right and get to cycle left or right each time an optical sensor is triggered, but i have no idea how to get it move to the reference point then count back to the home position for start of working.
can anyone help me get started please?
stepper motor uses pins 8,10,9,11 in that order and has a full revolution of 2048 steps and my sensor is on analogue pin 3