diff --git a/HotWaterManager.ino b/HotWaterManager.ino index a7b234e..1fd8e7c 100644 --- a/HotWaterManager.ino +++ b/HotWaterManager.ino @@ -670,6 +670,10 @@ void processmodes() { } printTemperature(readtemp(src),1); // Display the temperature + if(tempdata[src].failures) // If we failed to receive valid data from the sensor... + lcd.write('?'); // ... indicate this with a question mark... + else // ... othersiwse... + lcd.write(' '); // ... clear any previous error lcd.setCursor(0,1); pgmLcdPrint(modes[mode]); // Print the current operation mode @@ -680,20 +684,16 @@ void processmodes() { // Update the temperature trend arrow lcd.setCursor(13,0); - if(tempdata[src].failures) // If we failed to receive valid data from the sensor... - lcd.write('?'); // ... indicate this with a question mark... - else { #ifdef SIMTEMP - lcd.write(6); // Simulate upward trend + lcd.write(6); // Simulate upward trend #else - if(readtemp(0)-lastTemperature>=TRENDDELTA) { - lcd.write(6); // Trend is going up - lastTemperature=readtemp(0); - } else - if(lastTemperature-readtemp(0)>=TRENDDELTA) { - lcd.write(5); // Trend is going down - lastTemperature=readtemp(0); - } + if(readtemp(0)-lastTemperature>=TRENDDELTA) { + lcd.write(6); // Trend is going up + lastTemperature=readtemp(0); + } else + if(lastTemperature-readtemp(0)>=TRENDDELTA) { + lcd.write(5); // Trend is going down + lastTemperature=readtemp(0); } #endif lcd.setCursor(14,0);