This code works for me - I am using a Leadshine MA542 driver that has the same pin functions.
// domerotateBig.ino
// Version 03 12 Aug 2015
// DOME ROTATION MOTOR CONTROL
// This sketch is used on an Arduino Nano to generate the pulses, direction and enable signals required by the LEADSHINE MA542 stepper driver.
//
//INPUTS
// The 'proper' controller is an Arduino Mega. The Mega sets three lines which are read by the Nano to determine the action to be taken.
// The three Mega pins are read by the Nano on pins PD2 (2), PD3(3) and PD4 (4) so these are set as inputs. These three digital values are
// decoded to give 1 of 8 possible actionCommands.
// The values and corresponding actionCommands are:
// Pin 2 Pin 3 Pin 4 actionCommands
// 0 0 0 No Action
// 0 0 1 Rotate Clockwise
// 0 1 0 Rotate Anticlockwise
// 0 1 1 Graceful stop
// 1 0 0 Not yet assigned - defaults to Graceful stop
// 1 0 1 Not yet assigned - defaults to Graceful stop
// 1 1 0 Not yet assigned - defaults to Graceful stop
// 1 1 1 Emergency stop
//
//OUTPUTS
//The Arduino Nano provides the following digital outputs:
// direction signal to stepper driver Pin PB3 (11)
// pulse stream to stepper driver Pin PB4 (12)
// enable signal to stepper driver Pin PD1 (9)
// pulse stream to blackboard monitor Pin PD5 (5)
#include <AccelStepper.h>
//ACTION INPUT PINS
#define actPin0 2
#define actPin1 3
#define actPin2 4
//MA542 DRIVER PINS
#define stepPin 12
#define dirPin 11
#define enaPin 9
//CREATE INSTANCE OF STEPPER MOTOR
AccelStepper myMotor(AccelStepper::DRIVER, stepPin, dirPin, true);
//VARIABLE DECLARATIONS
int myAccel = 1;
int mySpeed;
long mySteps;
int myStatus;
boolean isMotorRunning = false;
long myCounter = 0;
boolean myStopflag = 0;
//TRIAL USING ACCELERATION EXAMPLE
void setup()
{
//Set minimum pulse width (2.5 uS for MA542 driver)
myMotor.setMinPulseWidth(10);
//SET UP ENABLE PIN
myMotor.setEnablePin(enaPin);
// ENABLE is Active Low
//Don't invert Direction and Step Pins, Invert Enable Pin
myMotor.setPinsInverted(false,false,true);
myMotor.enableOutputs();
myMotor.setMaxSpeed(937);
//myMotor.setSpeed(979);
myMotor.setAcceleration(100);
myMotor.moveTo(110000);
}
void loop()
{
//myMotor.runSpeed();
// If at the end of travel go to the other end
if (myMotor.distanceToGo() == 0)
myMotor.moveTo(-myMotor.currentPosition());
myMotor.run();
}