kin
This commit is contained in:
+10
-12
@@ -132,18 +132,16 @@ void parseCommand(const String &cmd) {
|
||||
Serial.printf("[S2] Move relative %+ld steps\n", steps);
|
||||
return;
|
||||
}
|
||||
// X1:<n> (Absolute)
|
||||
if (cmd.startsWith("X1:")) {
|
||||
long target = cmd.substring(3).toInt();
|
||||
stepper1.moveTo(target);
|
||||
Serial.printf("[S1] Move absolute to %ld\n", target);
|
||||
return;
|
||||
}
|
||||
// X2:<n> (Absolute)
|
||||
if (cmd.startsWith("X2:")) {
|
||||
long target = cmd.substring(3).toInt();
|
||||
stepper2.moveTo(target);
|
||||
Serial.printf("[S2] Move absolute to %ld\n", target);
|
||||
// X:<n1>,<n2> (Absolute combined)
|
||||
if (cmd.startsWith("X:")) {
|
||||
int commaIdx = cmd.indexOf(',');
|
||||
if (commaIdx != -1) {
|
||||
long target1 = cmd.substring(2, commaIdx).toInt();
|
||||
long target2 = cmd.substring(commaIdx + 1).toInt();
|
||||
stepper1.moveTo(target1);
|
||||
stepper2.moveTo(target2);
|
||||
Serial.printf("[X] Move absolute to %ld, %ld\n", target1, target2);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// SPD:<n>
|
||||
|
||||
Reference in New Issue
Block a user