Skip to content

Commit

Permalink
Update display brightness logging
Browse files Browse the repository at this point in the history
  • Loading branch information
melkati committed Mar 30, 2024
1 parent 59097f1 commit 1cb2e58
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CO2_Gadget.ino
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ void wakeUpDisplay() {
#if defined(SUPPORT_OLED) || defined(SUPPORT_TFT)
setDisplayBrightness(DisplayBrightness);
publishMQTTLogData("Display woken up. Setting display brightness to " + String(DisplayBrightness));
Serial.println("-->[MAIN] Display woken up. Setting display brightness to " + String(DisplayBrightness));
#endif
lastTimeButtonPressed = millis();
}
Expand Down Expand Up @@ -459,6 +460,7 @@ void adjustBrightnessLoop() {
if (actualDisplayBrightness == 0) {
setDisplayBrightness(DisplayBrightness); // Exception: When USB connected (just connected) & TFT is OFF -> Turn Display ON
publishMQTTLogData("Turning on display on external power. Actual brightness: " + String(actualDisplayBrightness));
Serial.println("-->[MAIN] Turning on display on external power. Actual brightness: " + String(actualDisplayBrightness));
}
return;
}
Expand Down
6 changes: 3 additions & 3 deletions CO2_Gadget_TFT.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ void setElementLocations() {
void setDisplayBrightness(uint16_t newBrightness) {
#ifdef TTGO_TDISPLAY
if (actualDisplayBrightness != newBrightness) {
// Serial.printf("\n-->[TFT ] DisplayBrightness value at %d\n", DisplayBrightness);
// Serial.printf("-->[TFT ] actualDisplayBrightness value at %d\n", actualDisplayBrightness);
// Serial.printf("-->[TFT ] New display brightness value at %d\n", newBrightness);
Serial.printf("\n-->[TFT ] DisplayBrightness value at %d\n", DisplayBrightness);
Serial.printf("-->[TFT ] actualDisplayBrightness value at %d\n", actualDisplayBrightness);
Serial.printf("-->[TFT ] New display brightness value at %d\n", newBrightness);
analogWrite(TFT_BACKLIGHT, newBrightness);
actualDisplayBrightness = newBrightness;
}
Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ build_flags =

-D MQTT_BROKER_SERVER="\"192.168.1.145"\"
-D CO2_GADGET_VERSION="\"0.12."\"
-D CO2_GADGET_REV="\"012"\"
-D CO2_GADGET_REV="\"015"\"
-D CORE_DEBUG_LEVEL=0
-DCACHE_DIR=".pio/build"
-DBUZZER_PIN=2 ; ESP32 pin GPIO13 connected to piezo buzzer
Expand Down

0 comments on commit 1cb2e58

Please sign in to comment.