Ok, I've got it, maybe it's done in stupid way but works like I wanted it to(moving 1000 clockwise, wait 2 secs, again 1000 clockwise and again 2 secs - in loop with acceleration and deacceleration).
#include <AccelStepper.h>
#define HALFSTEP 8
#define motorPin1 3 // IN1 on the ULN2003 driver 1
#define motorPin2 4 // IN2 on the ULN2003 driver 1
#define motorPin3 5 // IN3 on the ULN2003 driver 1
#define motorPin4 6 // IN4 on the ULN2003 driver 1
AccelStepper stepper1(HALFSTEP, motorPin1, motorPin3, motorPin2, motorPin4);
void setup() {
stepper1.setMaxSpeed(500.0);
stepper1.setAcceleration(75.0);
stepper1.setSpeed(100);
stepper1.moveTo(1000);
}
void loop() {
if (stepper1.distanceToGo() == 0) {
delay(2000);
stepper1.move(1000);
delay(2000);
}
stepper1.run();
}
MorganS Yes, all time the same direction, I tried runToPosition(), but there still were errors.