Hi im trying to build a homing feature and i added endstops.
My plan is to stop the movement (works) when hitting a endstop and cancel the moveTo (doesnt work).
When i release the endstop the motor still tries to reach the target position.
(im clicking the endstop for testing).
I tried doing some research and i found the .stop() call but during my research people seemed to have issues with it?
Do You want a thousand guesses to work through? Here's the first: You use AccelStepper. It's competent but not so easy to understand and use. Some functions are blocking, run until they are finished.
Other helpers suggest Moba Tools stepper library.
Either read more about AS or take a look at MobaTools.