Refactor backlight control and update display configuration in Cat Medication Tracker
This commit is contained in:
@@ -12,13 +12,12 @@ esphome:
|
|||||||
on_boot:
|
on_boot:
|
||||||
priority: 100
|
priority: 100
|
||||||
then:
|
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
|
- light.turn_on: backlight
|
||||||
- delay: 500ms
|
- delay: 300ms
|
||||||
- component.update: my_display
|
- 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:
|
esp32:
|
||||||
board: esp32dev
|
board: esp32dev
|
||||||
@@ -69,6 +68,8 @@ spi:
|
|||||||
clk_pin: GPIO14
|
clk_pin: GPIO14
|
||||||
mosi_pin: GPIO13
|
mosi_pin: GPIO13
|
||||||
miso_pin: GPIO12
|
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)
|
# ILI9488 Display (3.5" 320x480, portrait)
|
||||||
display:
|
display:
|
||||||
@@ -79,9 +80,8 @@ display:
|
|||||||
dc_pin: GPIO2
|
dc_pin: GPIO2
|
||||||
reset_pin: GPIO4
|
reset_pin: GPIO4
|
||||||
rotation: 0
|
rotation: 0
|
||||||
invert_colors: false
|
invert_colors: true
|
||||||
color_order: bgr
|
color_order: bgr
|
||||||
data_rate: 20MHz
|
|
||||||
dimensions:
|
dimensions:
|
||||||
width: 320
|
width: 320
|
||||||
height: 480
|
height: 480
|
||||||
@@ -223,7 +223,7 @@ output:
|
|||||||
- platform: gpio
|
- platform: gpio
|
||||||
pin: GPIO21
|
pin: GPIO21
|
||||||
id: backlight_pwm
|
id: backlight_pwm
|
||||||
inverted: true
|
inverted: false
|
||||||
|
|
||||||
light:
|
light:
|
||||||
- platform: binary
|
- platform: binary
|
||||||
|
|||||||
Reference in New Issue
Block a user