Does a stepper.run() command run during all the move of a motor AccelStepper ?

Hello,
First, I need to precise that I'm french, so my english might be approximative.
The thing that I wanna know is that, with the AccelStepper, when I start the command stepper.run() to start a motor, does it wait the end of the movement before going to the next line, or does it start it during the movement, meaning that I need to add a delay ?
Thanks for your reply.

Don't use delay() with AccelStepper.

The .run() function decides whether it is time to take a step, and if so, commands a step. Otherwise it does nothing.

Axelch64:
The thing that I wanna know is that, with the AccelStepper, when I start the command stepper.run() to start a motor, does it wait the end of the movement before going to the next line, or does it start it during the movement, meaning that I need to add a delay ?

It does neither. A single call to run() will cause a single step to be made IF it is time for the next step - otherwise nothing will happen.

If you read the AccelStepper documentation you will see that your program needs to call run() as frequently as possible and definitely more frequently than the required step rate - hence you should not use delay(). Note that when the stepper reaches its destination further calls to run() will have no effect.

If you do want a blocking move that halts the program until the move is complete you should use runToPosition()

...R

Well, thank you, it will be really helpful for me.

From the copious comments in AccelStepper.h:

/// This module operates by computing a step time in microseconds. The step
/// time is recomputed after each step and after speed and acceleration
/// parameters are changed by the caller. The time of each step is recorded in
/// microseconds. The run() function steps the motor once if a new step is due.
/// The run() function must be called frequently until the motor is in the
/// desired position, after which time run() will do nothing.

Its nearly always worth reading the comments in a library you are using, as well as checking
out the examples provided...