Noitoen - It's certainly possible to add a stop function from a programming point of view, but there are two problems with this.
The first problem is that the AccelStepper.h function which works best with stepper motors is a "blocking" function - there is no option to insert code to check for a stop button.
The second problem is that while there are other AccelStepper.h non-blocking functions which can be used in a while loop, inserting a check for a button press into the loop introduces a delay which adversely affects stepper motor function. This is especially true if checking for a keypad press because a keypad scan takes a long time (in computer terms). This option is implemented for the continuous run mode, but it results in greatly reduced maximum motor speed.
It may be that using an interrupt would resolve this issue, but I have not had time to try this yet.
Finally, I suppose the main reason I did not implement a stop function for index mode is that I did not really see a need for it. This may be because my main use for the indexer is to cut gear teeth, so the index moves are relatively small and are generally completed before I would have time to hit a stop button anyway. IS there a need for a stop button in index mode that I am not seeing?
The first problem is that the AccelStepper.h function which works best with stepper motors is a "blocking" function - there is no option to insert code to check for a stop button.
The second problem is that while there are other AccelStepper.h non-blocking functions which can be used in a while loop, inserting a check for a button press into the loop introduces a delay which adversely affects stepper motor function. This is especially true if checking for a keypad press because a keypad scan takes a long time (in computer terms). This option is implemented for the continuous run mode, but it results in greatly reduced maximum motor speed.
It may be that using an interrupt would resolve this issue, but I have not had time to try this yet.
Finally, I suppose the main reason I did not implement a stop function for index mode is that I did not really see a need for it. This may be because my main use for the indexer is to cut gear teeth, so the index moves are relatively small and are generally completed before I would have time to hit a stop button anyway. IS there a need for a stop button in index mode that I am not seeing?