AccelStepper
AccelStepper copied to clipboard
Run bug!
While I set Xaxis.move,Yaxis.move both negtive, both of two motor not run.
I am using ESP32 with arduino & TMC2209 driver.
I have tested that 3 type work and only 1 type not work.
Code:
#include <Arduino.h>
#include <AccelStepper.h>
AccelStepper Xaxis(1, 16, 17); // step, direction
AccelStepper Yaxis(1, 25, 26); // step, direction
void setup() {
int x_circle = 3200;
int y_circle = 3200;
Xaxis.setMaxSpeed(x_circle*8);
Yaxis.setMaxSpeed(y_circle*8);
Xaxis.setAcceleration(1*x_circle);
Yaxis.setAcceleration(1*y_circle);
// work!
// Xaxis.move(1*x_circle);
// Yaxis.move(1*y_circle);
// work!
// Xaxis.move(1*x_circle);
// Yaxis.move(-1*y_circle);
// work!
// Xaxis.move(-1*x_circle);
// Yaxis.move(1*y_circle);
// NOT WORK!
Xaxis.move(-1*x_circle);
Yaxis.move(-1*y_circle);
}
void loop() {
Xaxis.run();
Yaxis.run();
}
@waspinator my email: [email protected]. Thank you firstly!