AccelStepper iteration of functions

Well, the OP should still declare stepperX, stepperY and stepperZ as before, the array is just there to store the pointers to the 3 instances...

Of course we could get rid of these 3 variables and initialize the array another way...

EDIT: here we go…

This time stepper is an array of AccelStepper instances, not an array of AccepStepper pointers (like in my previous post):

AccelStepper stepper[] = {AccelStepper (1, 2, 5), AccelStepper (1, 3, 6)};

so now each instance can be accessed this way:

stepper[0].setMaxSpeed (100);
stepper[1].setMaxSpeed (100);

instead of:

stepper[0]->setMaxSpeed (100);
stepper[1]->setMaxSpeed (100);

when using an array of pointers…