Skip to content

Commit

Permalink
Merge pull request #300 from wrh3c/Add-maslowDelay
Browse files Browse the repository at this point in the history
Add maslowDelay
  • Loading branch information
BarbourSmith authored Sep 8, 2017
2 parents 3391459 + f0446fb commit 8ab71d8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions cnc_ctrl_v1/CNC_Functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,19 +343,23 @@ void pause(){
}

void maslowDelay(unsigned long waitTimeMs) {

/*
* Provides a time delay while holding the machine position, reading serial commands,
* and periodically sending the machine position to Ground Control. This prevents
* Ground Control from thinking that the connection is lost.
*
* This is similar to the pause() command above, but provides a time delay rather than
* waiting for the user (through Ground Control) to tell the machine to continue.
*/

unsigned long startTime = millis();

while ((millis() - startTime) < waitTimeMs){
delay(1);

holdPosition();

readSerialCommands();

returnPoz(xTarget, yTarget, zAxis.read());
}

}
}

bool checkForProbeTouch(const int& probePin) {
Expand Down

0 comments on commit 8ab71d8

Please sign in to comment.