Looking for examples of code for use with an UNO, to spin a optic wheel, via stepper motor to one of 5 positions, but also use a optical pin sensor to set the home position so any of the 5 positions could be selected from a button box.
Any examples around? I have found plenty of driving the stepper, but none with a starting home switch and referencing that position.
Also have an easy driver, if it would be easier to code using that.
Thoughts or ideas? am I in the correct forum, to post code and help questions for this project?
Implementing one (1) home position is quite easy, but more can be quite a trick. In this sense, it doesn't really care wether you want 2 or 5 homing positions.
Fortunately, you have a stepper motor with a fixed amount of steps per rotation. I don't know what stepper you have, but let's assume:
you have one with 1 degree per step.
your homing positions are 0deg, 72deg, 144deg, 216deg and 288deg.
Your optic wheel will only have one slot, at the homing position of 0deg. So when you press homing button 3, your code will first go tohoming position 0, and then do 144 steps to the right. When you press homing button 4, it first goes to homing position 0, and then go 72 steps left.
Thanks that idea would simplify what I was trying to do, I'll just have to see if I have time to seek home before every move. I was planning on at power up have it zero home, then actually keep track of step count and preform calculation as to where to go. But simply going home first would be the easiest solution. i'll have to check rotation time an see if it will work. Thanks