#include <AccelStepper.h>
const int stepPin1 = 2;
const int directionPin1 = 3;
const int enablePin = 4;
const int lim_1 = 7;
const int lim_2 = 8;
AccelStepper stepper1(AccelStepper::DRIVER, stepPin1, directionPin1);
int led = 13;
int lim1 = 0;
int lim2 = 0;
void setup() {
// put your setup code here, to run once:
stepper1.setEnablePin(enablePin);
stepper1.enableOutputs();
stepper1.setMaxSpeed(500000);
stepper1.setSpeed(500000);
stepper1.setAcceleration(200);
}
void loop() {
// put your main code here, to run repeatedly:
//if (stepper1.currentPosition() < 500){
stepper1.moveTo(1500);
stepper1.run();
//}
}