fix pen commands

Signed-off-by: Stepan Usatyuk <usaatyuk@ustk.me>
This commit is contained in:
2019-05-18 15:27:34 +03:00
parent 704fe420e7
commit a1d59ea6b0
5 changed files with 17 additions and 19 deletions

View File

@@ -84,21 +84,23 @@ void execCommand(float *command) {
needAdjust = false;
}
if (command[X] != -1) {
if (!isnan(command[X])) {
servoStepper.moveTo(command[X]);
}
if (command[Y] != -1) {
if (!isnan(command[Y])) {
eggStepper.moveTo(command[Y]);
}
if (command[Z] < 0) {
pen.engage();
if (!isnan(command[Z])) {
if (command[Z] < 0) {
pen.engage();
}
if (command[Z] >= 0) {
pen.disengage();
}
}
if (command[Z] >= 0) {
pen.disengage();
}
adjustRPM();
return;