From 75fe43ddcb195ef2bf017587968e41a66f5e2467 Mon Sep 17 00:00:00 2001 From: Sandy Noble Date: Sun, 19 Aug 2018 16:48:04 +0100 Subject: [PATCH] Added handler for 5-part SYNC command. --- polargraphcontroller.pde | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/polargraphcontroller.pde b/polargraphcontroller.pde index cc75a80..93e6154 100644 --- a/polargraphcontroller.pde +++ b/polargraphcontroller.pde @@ -2383,6 +2383,16 @@ void readMachinePosition(String sync) currentMachinePos.y = b; currentMachinePos = getDisplayMachine().inMM(getDisplayMachine().asCartesianCoords(currentMachinePos)); } + else if (splitted.length == 5) + { + String currentAPos = splitted[2]; + String currentBPos = splitted[3]; + Float a = Float.valueOf(currentAPos).floatValue(); + Float b = Float.valueOf(currentBPos).floatValue(); + currentMachinePos.x = a; + currentMachinePos.y = b; + currentMachinePos = getDisplayMachine().inMM(getDisplayMachine().asCartesianCoords(currentMachinePos)); + } } void readCartesianMachinePosition(String sync) {