Update st7789v.rst (#2622)

* Update st7789v.rst

Modified to allow dimmable control of the backlight (using GPIO4)

* Update st7789v.rst

---------

Co-authored-by: H. Árkosi Róbert <robreg@zsurob.hu>
This commit is contained in:
Mike Ellis 2023-02-05 19:28:12 +00:00 committed by GitHub
parent fd4fd55333
commit a34f2c8679
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 25 deletions

View File

@ -217,35 +217,38 @@ appropriate lines of C code in the lambda to hide or show the image or text as y
name: "T-Display Button Input 1"
id: tdisplay_button_input_1
# We can still control the backlight independently
switch:
- platform: gpio
pin: GPIO4
name: "Backlight"
id: backlight
# Allow dimmable control of the backlight (pin GPIO4)
output:
- platform: ledc
pin: GPIO4
id: gpio4
image:
- file: "image.png"
id: my_image
resize: 200x200
type: RGB24
light:
- platform: monochromatic
output: gpio4
name: "Backlight"
time:
- platform: homeassistant
id: esptime
image:
- file: "image.png"
id: my_image
resize: 200x200
type: RGB24
spi:
clk_pin: GPIO18
mosi_pin: GPIO19
time:
- platform: homeassistant
id: esptime
display:
- platform: st7789v
backlight_pin: GPIO4
cs_pin: GPIO5
dc_pin: GPIO16
reset_pin: GPIO23
rotation: 270
lambda: |-
spi:
clk_pin: GPIO18
mosi_pin: GPIO19
display:
- platform: st7789v
cs_pin: GPIO5
dc_pin: GPIO16
reset_pin: GPIO23
rotation: 270
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height(), id(my_blue));
it.rectangle(0, 20, it.get_width(), it.get_height(), id(my_blue)); // header bar
@ -263,6 +266,7 @@ appropriate lines of C code in the lambda to hide or show the image or text as y
it.print(235, 5, id(helvetica_12), id(my_red), TextAlign::TOP_RIGHT, "Offline");
}
See Also
--------