From 3fda6ff2fb2081067316203fb5327c6801aba517 Mon Sep 17 00:00:00 2001 From: jupfi Date: Thu, 7 Dec 2023 18:45:53 +0100 Subject: [PATCH] Fixed bug which lead to negative voltages. --- src/commands/VoltageSweep.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/commands/VoltageSweep.cpp b/src/commands/VoltageSweep.cpp index 6676295..ab0d12d 100644 --- a/src/commands/VoltageSweep.cpp +++ b/src/commands/VoltageSweep.cpp @@ -77,6 +77,12 @@ void VoltageSweep::printResult() // Print the results which are then read by the autotm module char identifier = 'v'; char delimiter = 't'; + + if (tuning_voltage < 0.0 || matching_voltage < 0.0) + { + tuning_voltage = 0.0; + matching_voltage = 0.0; + } String text = String(identifier) + String(matching_voltage) + String(delimiter) + String(tuning_voltage); Serial.println(text);