Stepper motor CNC shield accelstepper.h

I can't speak for @sterretje, but since he put it in Motors, Mechanics, Power and CNC, I would assume that that is the section that he thinks is appropriate.

In your code in reply #6 the stepper only moves 3 times because you set the currentPosition to 0 then the first move in the array is to 0. The stepper is already there (at 0) so no move occurs.

How about this (delay set to 2000 to be able to see the pause):

#include <AccelStepper.h>
const unsigned int NUM_STEPS = 4;

unsigned int xArray[NUM_STEPS] = {50, 100, 150, 200};  // removed 0, added 200
unsigned int xSpeeds[NUM_STEPS] = {200, 200, 200, 200};

const byte enablePin = 8;

AccelStepper x_stepper(AccelStepper::DRIVER, 2, 5);
static unsigned int index = 0;
void setup()
{
   Serial.begin(115200);
   pinMode(enablePin, OUTPUT);
   digitalWrite(enablePin, LOW);
   x_stepper.setAcceleration(2000);
   x_stepper.setMaxSpeed(200);
   x_stepper.setSpeed(200);
   x_stepper.setCurrentPosition(0);
}

void loop()
{

   if (x_stepper.run() == 0)
   {
      delay(250);
      Serial.println(index);
      x_stepper.moveTo(xArray[index]);
      x_stepper.setMaxSpeed(xSpeeds[index]);
      index++;
      if (index > NUM_STEPS) // changed from >= to > to get 4 steps
      {
         index = 0;
         x_stepper.setCurrentPosition(0);
         delay(2000);
      }
   }
}