Added ability to chain enable(), disable(), and brake()

This commit is contained in:
Gregg 2023-07-08 17:56:33 -05:00
parent f7419da35b
commit 6aedec5a2d
2 changed files with 12 additions and 8 deletions

View File

@ -117,25 +117,29 @@ void StepperControl::waitForAck(){
//////////////////////////
void StepperControl::brake(){
StepperControl *StepperControl::brake(){
move(0,10,BRAKE);
while(stepsRemaining());
return(this);
}
//////////////////////////
void StepperControl::disable(){
StepperControl *StepperControl::disable(){
move(0,10,DISABLE);
while(stepsRemaining());
return(this);
}
//////////////////////////
void StepperControl::enable(){
StepperControl *StepperControl::enable(){
move(0,10);
while(stepsRemaining());
}//////////////////////////
return(this);
}
//////////////////////////
void StepperControl::motorTask(void *args){
StepperControl *motor = (StepperControl *)args;

View File

@ -97,9 +97,9 @@ class StepperControl {
int position();
void setPosition(int pos);
int stepsRemaining();
void enable();
void disable();
void brake();
StepperControl *enable();
StepperControl *disable();
StepperControl *brake();
};
//////////////////////////