Accelstepper stepping selection

If you want a stepper motor to behave like a servo - for example moving half-way when you move the joystick half-way - then I wonder if the AccelStepper library is worth the trouble.

The first complexity I see is the likelihood that the joystick will be moved to a new position before the motor (or servo) gets to its destination. AFAIK the AccelStepper library does not have a convenient mechanism to deal with that. The AccelStepper library is designed for symmetrical acceleration and deceleration from 0 to max and back to zero. If you change the destination before the motor stops, what do you want to happen?

The next complexity is acceleration. Servos have acceleration built into them so you don't have to think about it. You can operate stepper motors without acceleration but they will need to be operated at a slow enough step rate if they are not to miss steps.

Then (though it is not a library issue) there is the complexity of establishing the zero position for a stepper motor. Servos have potentiometers on their output shafts which establish the position. Stepper motors don't and they need to have their zero position established every time the Arduino starts. And if they miss steps during movements they will need to re-establish the zero position.

If you do want to experiment with the AccelStepper library then use one of the non-blocking functions - such as run() - and change the value of moveTo() whenever the joystick position changes. Make sure to call run() in loop() - not inside any other function or IF statement - and call it as often as possible. The code at the bottom of your loop() might be

   motorA.run();
   motorB.run();
}

...R