Fixed bug which lead to negative voltages.

This commit is contained in:
jupfi 2023-12-07 18:45:53 +01:00
parent 723c36fca8
commit 3fda6ff2fb

View file

@ -77,6 +77,12 @@ void VoltageSweep::printResult()
// Print the results which are then read by the autotm module // Print the results which are then read by the autotm module
char identifier = 'v'; char identifier = 'v';
char delimiter = 't'; 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); String text = String(identifier) + String(matching_voltage) + String(delimiter) + String(tuning_voltage);
Serial.println(text); Serial.println(text);