From 6dcab86122567cb17f88a2f9458bfbf4f3afb347 Mon Sep 17 00:00:00 2001 From: Joshua King Date: Fri, 6 Mar 2026 13:50:48 -0500 Subject: [PATCH] Refactor backlight control and update display configuration in Cat Medication Tracker --- esphome/cat-medication-tracker.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/esphome/cat-medication-tracker.yaml b/esphome/cat-medication-tracker.yaml index 95c0717..66d0924 100644 --- a/esphome/cat-medication-tracker.yaml +++ b/esphome/cat-medication-tracker.yaml @@ -12,13 +12,12 @@ esphome: on_boot: priority: 100 then: + # Force backlight on after a short delay so we can confirm it is wired correctly. + - light.turn_off: backlight + - delay: 300ms - light.turn_on: backlight - - delay: 500ms + - delay: 300ms - component.update: my_display - -psram: - # Enable external RAM for large TFT framebuffer usage if available. - # With no PSRAM module present, this is a no-op. esp32: board: esp32dev @@ -69,6 +68,8 @@ spi: clk_pin: GPIO14 mosi_pin: GPIO13 miso_pin: GPIO12 + # Set bus rate here to ensure the TFT doesn't run too fast at startup. + frequency: 20MHz # ILI9488 Display (3.5" 320x480, portrait) display: @@ -79,9 +80,8 @@ display: dc_pin: GPIO2 reset_pin: GPIO4 rotation: 0 - invert_colors: false + invert_colors: true color_order: bgr - data_rate: 20MHz dimensions: width: 320 height: 480 @@ -223,7 +223,7 @@ output: - platform: gpio pin: GPIO21 id: backlight_pwm - inverted: true + inverted: false light: - platform: binary