#include <AccelStepper.h>
#define ENABLEX_PIN 13
#define STEPX_PIN 12
#define DIRX_PIN 11
#define ENABLEY_PIN 13
#define STEPY_PIN 12
#define DIRY_PIN 11
#define ENABLEZ_PIN 13
#define STEPZ_PIN 12
#define DIRZ_PIN 11
AccelStepper stepperX(AccelStepper::DRIVER, STEPX_PIN, DIRX_PIN);
AccelStepper stepperY(AccelStepper::DRIVER, STEPX_PIN, DIRX_PIN);
AccelStepper stepperZ(AccelStepper::DRIVER, STEPX_PIN, DIRX_PIN);
void setup() {
// put your setup code here, to run once:
// Set the maximum speed and acceleration
stepperX.setMaxSpeed(1000);
stepperX.setAcceleration(100);
// Optionally, enable the driver
pinMode(ENABLE_PIN, OUTPUT);
digitalWrite(ENABLE_PIN, LOW); // LOW to enable
}
void loop() {
// put your main code here, to run repeatedly:
// Move the motor to a position
stepperX.moveTo(200);
stepperX.runSpeed();
}