我已经成功实例化了accelstepper对象:
//Create accelstepper object for the Z-Axis actuator
AccelStepper zaxis(AccelStepper::DRIVER, ZSTEP, ZDIR);
//Create accelstepper object for the theta axis actuator
AccelStepper taxis(AccelStepper::DRIVER, TSTEP, TDIR);
//Create accelstepper object for the magnet actuator
AccelStepper maxis(AccelStepper::DRIVER, MSTEP, MDIR);
现在我正在尝试对这些对象进行一些基本设置:
void stepper_setup(){
//Set Max Speed in steps per second
zaxis.setMaxSpeed(100);
taxis.setMaxSpeed(100);
maxis.setMaxSpeed(100);
//Set Acceleration in steps per second squared
zaxis.setAcceleration(500);
taxis.setAcceleration(500);
maxis.setAcceleration(500);
//Home the Zaxis, Taxis, Maxis
zaxis.moveTo(100000); taxis.moveTo(100000); maxis.moveTo(100000);
zaxis.run(); taxis.run(); maxis.run();
但是,编译器向我抛出以下错误:
.pio\build\nucleo_f410rb\lib799\libAccelStepper.a(AccelStepper.o): In function `AccelStepper::runSpeed()':
c:\Users\USER\Documents\PROJECTFOLDER\Codes\PROJECT TITLE/.pio\libdeps\nucleo_f410rb\AccelStepper/AccelStepper.cpp:63: undefined reference to `t'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\nucleo_f410rb\firmware.elf] Error 1
当在有问题的AccelStepper.cpp中查找有问题的第63行时,我只能找到此行:
_currentPos -= 1;
This is the picture of the problematic line和
This is the picture of the error thrown in the compiler
这没有任何意义。我想念什么吗?任何帮助将不胜感激!