From da56b30be25fc654986fe195351a175eb9c9b748 Mon Sep 17 00:00:00 2001 From: ianhawkdev Date: Sat, 17 Jul 2021 13:30:32 +0100 Subject: [PATCH] Add an alternative method of triggering calibration via the com port. This allows calibration of devices without buttons --- HandbellController/HandbellController.ino | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/HandbellController/HandbellController.ino b/HandbellController/HandbellController.ino index 4e1360d..e62ec8d 100644 --- a/HandbellController/HandbellController.ino +++ b/HandbellController/HandbellController.ino @@ -359,6 +359,13 @@ static bool UpdateCalibrationMode() { _calibrationHoldTime = currentTime; } + // Alternatively check if there is serial input and enter calibration mode if so + // This permits calibration of devices that do not have buttons + if (Serial.available()){ // there is input + while (Serial.read()!=-1); // empty out the input buffer + _calibrationMode = true; + calibration_setup(); + } } return _calibrationMode; }