add standardized text display for stats
This commit is contained in:
parent
0a6d966efb
commit
ec88a00145
@ -277,6 +277,11 @@ void loop(void) {
|
|||||||
drawButton(0, 20, 320, 110, "Stop", "ILI9341_RED");
|
drawButton(0, 20, 320, 110, "Stop", "ILI9341_RED");
|
||||||
drawButton(160, 130, 160, 110, "Back", "ILI9341_BLUE");
|
drawButton(160, 130, 160, 110, "Back", "ILI9341_BLUE");
|
||||||
}
|
}
|
||||||
|
if (menu == 2) {
|
||||||
|
drawButton(160, 130, 160, 110, "Back", "ILI9341_BLUE");
|
||||||
|
displayText(2, 30, false, 4);
|
||||||
|
// moisture, temperature, next cycle, how much water, power usage, sensor connections
|
||||||
|
}
|
||||||
upd = false;
|
upd = false;
|
||||||
}
|
}
|
||||||
if(Serial.available() > 0) {
|
if(Serial.available() > 0) {
|
||||||
@ -690,3 +695,11 @@ void button(int x, int y) {
|
|||||||
}
|
}
|
||||||
delay(250);
|
delay(250);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void displayText(int x, int y, boolean center, String text, int size) {
|
||||||
|
if (center) {
|
||||||
|
tft.drawCentreString(text, x, y, size);
|
||||||
|
} else {
|
||||||
|
tft.drawString(text, x, y, size);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user