From 4e177252c9c5ae9d407f66f9c54d70a888448347 Mon Sep 17 00:00:00 2001 From: Daniel Eichhorn Date: Sun, 9 Jul 2017 19:17:46 +0200 Subject: [PATCH] Added simple uptime --- esp8266-weather-station-color.ino | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/esp8266-weather-station-color.ino b/esp8266-weather-station-color.ino index a47371d..917e083 100644 --- a/esp8266-weather-station-color.ino +++ b/esp8266-weather-station-color.ino @@ -429,6 +429,7 @@ void drawCurrentWeatherDetail() { drawLabelValue(6, "Pressure:", conditions.pressure); drawLabelValue(7, "Precipitation:", conditions.precipitationToday); drawLabelValue(8, "UV:", conditions.UV); + gfx.setTextAlignment(TEXT_ALIGN_LEFT); gfx.setColor(MINI_YELLOW); gfx.drawString(15, 185, "Description: "); @@ -501,14 +502,18 @@ void drawAbout() { gfx.setFont(ArialRoundedMTBold_14); gfx.setTextAlignment(TEXT_ALIGN_CENTER); + drawLabelValue(7, "Heap Mem:", String(ESP.getFreeHeap() / 1024)+"kb"); + drawLabelValue(8, "Flash Mem:", String(ESP.getFlashChipRealSize() / 1024 / 1024) + "MB"); + drawLabelValue(9, "WiFi Strength:", String(WiFi.RSSI()) + "dB"); + drawLabelValue(10, "Chip ID:", String(ESP.getChipId())); + drawLabelValue(11, "VCC: ", String(ESP.getVcc() / 1024.0) +"V"); + drawLabelValue(12, "CPU Freq.: ", String(ESP.getCpuFreqMHz()) + "MHz"); + drawLabelValue(13, "Uptime: ", String(millis() / 1000) + "s"); + gfx.setTextAlignment(TEXT_ALIGN_LEFT); + gfx.setColor(MINI_YELLOW); + gfx.drawString(15, 250, "Last Reset: "); gfx.setColor(MINI_WHITE); - gfx.drawString(120, 115, "About"); - drawLabelValue(8, "Heap Mem:", String(ESP.getFreeHeap() / 1024)+"kb"); - drawLabelValue(9, "Flash Mem:", String(ESP.getFlashChipRealSize() / 1024 / 1024) + "MB"); - drawLabelValue(10, "WiFi Strength:", String(WiFi.RSSI()) + "dB"); - drawLabelValue(11, "Chip ID:", String(ESP.getChipId())); - drawLabelValue(12, "VCC: ", String(ESP.getVcc() / 1024.0) +"V"); - drawLabelValue(13, "CPU Freq.: ", String(ESP.getCpuFreqMHz()) + "MHz"); + gfx.drawStringMaxWidth(15, 265, 240 - 2 * 15, ESP.getResetInfo()); } void calibrationCallback(int16_t x, int16_t y) {