Go Down

Topic: Step Motor Help (Read 583 times) previous topic - next topic

king1hw

I am looking for a sketch that can run 3 axis step motors.  I have the motor drivers and the Arduino uno board. 

#include <AccelStepper.h>

//AccelStepper Xaxis(1, 2, 5); // pin 2 = step, pin 5 = direction
//AccelStepper Yaxis(1, 3, 6); // pin 3 = step, pin 6 = direction
//AccelStepper Zaxis(1, 4, 7); // pin 4 = step, pin 7 = direction

AccelStepper Xaxis(1, 3, 6); // pin 3 = step, pin 6 = direction
AccelStepper Yaxis(1, 4, 7); // pin 4 = step, pin 7 = direction
AccelStepper Zaxis(1, 5, 9); // pin 5 = step, pin 8 = direction

void setup() {
  Xaxis.setMaxSpeed(400);
  Yaxis.setMaxSpeed(400);
  Zaxis.setMaxSpeed(400);
  Xaxis.setSpeed(45);
  Yaxis.setSpeed(25);
  Zaxis.setSpeed(80);
}

void loop() { 
   Xaxis.runSpeed();
   Yaxis.runSpeed();
   Zaxis.runSpeed();
}


PaulS

Quote
I am looking for a sketch that can run 3 axis step motors.
But you still can't explain what "run 3 steppers" means.

Go Up