Commanding a stepper motor to make a series of movements in a specific order

Sorry, but this will not work because run does only 1 step at max. If you want a blocking move you could do

    for (int idx = 0; idx < Npos; idx++)  {
        Serial.println   (pos [idx].desc);
        myStepper.runToNewPosition (pos [idx].nStep);
        delay            (pos [idx].msec);
    }
1 Like