diff --git a/CO2_Gadget.ino b/CO2_Gadget.ino index 645d6ad4..b3b8ce85 100644 --- a/CO2_Gadget.ino +++ b/CO2_Gadget.ino @@ -104,7 +104,7 @@ uint16_t batteryFullyChargedMillivolts = 4200; // Voltage of battery when it is // Variables to control automatic display off to save power bool workingOnExternalPower = true; // True if working on external power (USB connected) -uint32_t actualDisplayBrightness = 100; // To know if it's on or off +uint32_t actualDisplayBrightness = 0; // To know if it's on or off bool displayOffOnExternalPower = false; uint16_t timeToDisplayOff = 0; // Time in seconds to turn off the display to save power. volatile uint64_t lastTimeButtonPressed = 0; // Last time stamp button up was pressed diff --git a/CO2_Gadget_OLED.h b/CO2_Gadget_OLED.h index f34ee926..c998ff10 100644 --- a/CO2_Gadget_OLED.h +++ b/CO2_Gadget_OLED.h @@ -79,6 +79,7 @@ void initDisplay() { } else { u8g2.setDisplayRotation(U8G2_R0); } + setDisplayBrightness(DisplayBrightness); displaySplashScreen(); delay(1000); } diff --git a/CO2_Gadget_TFT.h b/CO2_Gadget_TFT.h index 039bd32e..166469e7 100644 --- a/CO2_Gadget_TFT.h +++ b/CO2_Gadget_TFT.h @@ -300,6 +300,7 @@ void initDisplay() { setElementLocations(); tft.setTextSize(2); initBacklight(); + setDisplayBrightness(DisplayBrightness); displaySplashScreen(); // Display init and splash screen delay(2000); // Enjoy the splash screen for 2 seconds spr.setColorDepth(16); diff --git a/platformio.ini b/platformio.ini index c2edbc44..6288dda4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -42,7 +42,7 @@ build_flags = -D MQTT_BROKER_SERVER="\"192.168.1.145"\" -D CO2_GADGET_VERSION="\"0.12."\" - -D CO2_GADGET_REV="\"021"\" + -D CO2_GADGET_REV="\"022"\" -D CORE_DEBUG_LEVEL=0 -DCACHE_DIR=".pio/build" -DBUZZER_PIN=2 ; ESP32 pin GPIO13 connected to piezo buzzer