Hi, I'd like to know if there is a code in arduino to psition a stepper motor, I mean, to set alway de initial pisition of the stepper ...??
@nitsugarduino, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with your project See About the Installation & Troubleshooting category.
No experience with steppers so can't advise.
There’s no single ‘command’, but assuming you have your hardware sorted out, there are several strategies you might use to achieve your plan.
Best thing is to post your existing code (in code tags) and a sketch or photo of your intended mechanical arrangements.
Eventually, you’ll want to draw up a schematic/circuit diagram with all pins & connections labelled.
It depends how you need it to work. For example, if the stepper rotation is converted to linear motion (for example, turns a lead screw) then you might want to use a limit switch. If you need to set the initial position of the motor based on the shaft position then you will need some other method. Either way it will take some hardware support since normal steppers provide no feedback as to their position.
Connect end switch.
Run stepper fowards end switch.
Till it toggles switch.
Back up till switch goes back to nornal.
Slooowoly move till switch changes state.
Then set steps to o.oooo