//accelstepper constant speed example has been altered and is being used
// not using default 4 wires setup, but instead using step, direction, and enable pins
// using TB6600 4A 9-42V stepper driver at 6400 pulses/rev (32 microsteps)
#include <AccelStepper.h>
// defines pins numbers
const int stepPin = 6;
const int directionPin = 5;
const int enablePin = 4;
// Define a stepper and the pins it will use
// 1 or AccelStepper::DRIVER means a stepper driver (with Step and Direction pins)
AccelStepper stepper(AccelStepper::DRIVER, stepPin, directionPin);
void setup()
{
// Change these to suit your stepper if you want
stepper.setMaxSpeed(2000);
stepper.setAcceleration(5000);
stepper.moveTo(2000);
stepper.setSpeed(200);
}
void loop()
{
stepper.runSpeedToPosition();
stepper.run();
}