Asynchronous stepper motor library
-
I have an arduino mega that's connected to two stepper motors. Each stepper motor has one stop/limit switch that would indicate the end of the travel distance. I'm using "AccelStepper" library to control the motors. I'm also using the "Eventually" event-based lib to do perform some action when an event occurs.
Everything works great in serial fashion. But I need to have a few things run at the same time. The two stepper motors, for example. The issue that I have is AccelStepper is blocking meaning that once I call "runToPosition" function call, nothing else happens unless and until the function returns.
I looked at "Metro" and "Chrono" packages but again since the "runToPosition" is a blocking function call, everything comes to the halt until the function call returns.
Of course, one thing I can do is move each motor a few degrees in a loop with AccelStepper lib or just pulsing it. But I was wondering if there is any stepper motor libs that are asynchronous? Something like fire-and-forget. Thanks all.
-
@otto22 Hi. This might help https://forum.arduino.cc/t/2-s...