Go Down

Topic: Stepper library changes (Read 1 time) previous topic - next topic

ajofscott

While building the controls for my Harbor Freight micromill I became aware that the step method was non blocking in the sense that the call returned whether or not an actual step took place. I modified the library to return a boolean state, true if the motor stepped and false if it didn't. It would be rare to have a stepper take off and step 'n' steps without coordinating those steps with other steppers in the same system.

robtillaart


How would someone use this boolean state in a real sketch?

Must I call step again to get the step done?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

ajofscott

No, the boolean return value has no effect on the function of the stepper object, but is a means to inform the caller as to whether the step request succeeded or not. I used the boolean to have my code continue to call step until it actually stepped as I am using accumulators for coordinates as I do not have a DRO on the machine.

Go Up