stepper motor library step function - blocking?

Hi,

Trying to use the stepper library, everything works correctly with single steps in the loop, but when I step a large number of steps, ie. myStepper.step(2000), should I expect this procedure to block the loop (delay the code execution) while it steps?

I apologize, I am new to C++ programming and interpreting the libraries is still mostly beyond my capabilities

Thanks.

I have no experience of the library but even if the function does block then why not use myStepper.step(1); and count the number of times that you do it. Doing it that way would allow you 2000 opportunities to do something else between steps.

The Stepper library is very basic. The AccelStepper library can be used in non-blocking mode.

If you are using a stepper driver that just needs step and direction signals (you should be :slight_smile: ) you may not need any library.

And, as @UKHeliBob suggests, you could just make series of calls 1 step at a time and manage the interval between steps yourself.

...R
Stepper Motor Basics
Simple Stepper Code

how can i use the AccelStepper library or similar without the on loop blocking?

moebiussurfing:
how can i use the AccelStepper library or similar without the on loop blocking?

Have you tried any of the examples that come with the library?

Start with them. Then if you have a specific question about something you don't understand, please ask it.

...R