firmware wip - Notification about Maintenance Mode on display

This commit is contained in:
Marcus 2024-05-08 18:38:54 +02:00
parent 9e0c5056ae
commit 330b3e7649

View file

@ -1355,67 +1355,78 @@ void displayScreens() {
} }
display.setCursor(0,0); display.setCursor(0,0);
if(MaintenanceMode == true) {
display.drawBitmap(0, 0, bmpCanGrow_Logo, 128, 32, WHITE);
display.display();
display.setCursor(0,32);
display.println("Maintenance mode active");
display.print("Time left: ");
display.print(MaintenanceDuration - ((millis() - MaintenanceStarted) / 1000));
display.println("s");
} else {
// in this switch case the single screens gets defined // in this switch case the single screens gets defined
switch(ScreenToDisplay) { switch(ScreenToDisplay) {
case 0: case 0:
display.print("Humidity: "); display.print("Humidity: ");
display.print(valHumidity); display.print(valHumidity);
display.println(" %"); display.println(" %");
display.println(""); display.println("");
display.print("Temperature: "); display.print("Temperature: ");
display.print(valTemperature); display.print(valTemperature);
display.println(" C"); display.println(" C");
display.println(""); display.println("");
display.print("Moisture: "); display.print("Moisture: ");
display.print(valSoilmoisture); display.print(valSoilmoisture);
display.println(" %"); display.println(" %");
display.println(""); display.println("");
if(UsePump == true) { if(UsePump == true) {
display.print("Pump Waterlvl: "); display.print("Pump Waterlvl: ");
switch(valWaterlevel) { switch(valWaterlevel) {
case 0: case 0:
display.println("OK"); display.println("OK");
break; break;
case 1: case 1:
display.println("Warn"); display.println("Warn");
break; break;
case 2: case 2:
display.println("Crit"); display.println("Crit");
break; break;
}
} }
} break;
break;
case 1:
case 1: display.print("LED: ");
display.print("LED: "); display.print(PinLEDPWM * 100 / 255);
display.print(PinLEDPWM * 100 / 255); display.println(" %");
display.println(" %"); display.print("State: ");
display.print("State: "); display.println(digitalRead(PinLED));
display.println(digitalRead(PinLED)); display.println("");
display.println(""); display.print("FAN: ");
display.print("FAN: "); display.print(PinFANPWM * 100 / 255);
display.print(PinFANPWM * 100 / 255); display.println(" %");
display.println(" %"); display.print("State: ");
display.print("State: "); display.println(digitalRead(PinFAN));
display.println(digitalRead(PinFAN)); display.println("");
display.println(""); display.print("Pump state: ");
display.print("Pump state: "); display.println(digitalRead(PinPUMP));
display.println(digitalRead(PinPUMP)); break;
break;
case 2:
case 2: // display Logo
// display Logo display.drawBitmap(0, 0, bmpCanGrow_Logo, 128, 32, WHITE);
display.drawBitmap(0, 0, bmpCanGrow_Logo, 128, 32, WHITE); display.display();
display.display(); display.setCursor(0,32);
display.setCursor(0,32); display.println(GrowName);
display.println(GrowName); display.print("DoG: ");
display.print("DoG: "); display.print(DayOfGrow);
display.print(DayOfGrow); display.print(", ");
display.print(", "); display.println(timeClient.getFormattedTime());
display.println(timeClient.getFormattedTime()); display.print("IP: ");
display.print("IP: "); display.println(WiFi.localIP());
display.println(WiFi.localIP()); break;
break; }
} }
ScreenIterationPassed++; ScreenIterationPassed++;
display.display(); display.display();