How to tell if TeensyStep controller is still moving, or has reached its setPoint?

Status
Not open for further replies.

roach374

Member
I'm using the excellent TeensyStep library to control stepper motors in my project. It's definitely made some things easier.

There doesn't seem to be any API to access the private 'target' member in the Stepper class, nor any API in the controller to determine if the controller has reached it's target or not (ie: Is it still moving?) This would be handy after calling moveAsync, to poll the controller for the current status of its motors.
 
Looking at the github readme shows this?:
The move command is blocking. I.e., it will not return until the movement is finished. If you need to do some work while the motors are rotating you can use the non blocking moveAsync command.
...
controller.moveAsync(motor_1, motor_2); // This will start the movement and return immediately
doSomeWork();

while(controller.isRunning()){ // wait until the movement is finished
delay(10);
}

Does that give what is needed?
 
Status
Not open for further replies.
Back
Top