Hello everyone,
i have recently bought the WaveShare ESP32 S3 4 Inch Touch Display and i just cant get it to work… i have tried different codes and all.
Here I found infos about the pins (gotta click expand to see the table etc) :
This is my latest code I tried from someone else :
esphome:
name: waveshare-display-1
friendly_name: Waveshare Display 1
esp32:
board: esp32-s3-devkitc-1
framework:
type: esp-idf
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "DzYwkknAlg2sntfxjwSfeUal0DE8o/15bfHEQhSVYUc="
ota:
- platform: esphome
password: "30d1750551d86d2bde7d5961989c1718"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Waveshare-Display-1"
password: "Lr9o4FyIcvbR"
captive_portal:
i2c:
- sda: GPIO15
scl: GPIO07
scan: True
id: bus_a
display:
- platform: rpi_dpi_rgb
id: display1
auto_clear_enabled: false
color_order: RGB
dimensions:
width: 480
height: 480
reset_pin:
pca9554: pca9554a_device
number: 3
de_pin: GPIO40
hsync_pin: GPIO38
vsync_pin: GPIO39
pclk_pin: GPIO41
# Replace XX with the correct pin number
data_pins:
red:
- 46 #r1
- 03 #r2
- 08 #r3
- 18 #r4
- 17 #r5
green:
- 14 #g0
- 13 #g1
- 12 #g2
- 11 #g3
- 10 #g4
- 09 #g5
blue:
- 05 #b1
- 45 #b2
- 48 #b3
- 47 #b4
- 21 #b5
font:
- file: "gfonts://Roboto"
id: chu_nano
size: 20
touchscreen:
- platform: gt911
id: my_touch
display: display1
psram:
mode: octal
speed: 80MHz
pca9554:
- id: 'pca9554a_device'
i2c_id: bus_a
address: 0x20
lvgl:
buffer_size: 25%
pages:
- id: clock_page
widgets:
- obj: # Clock container
height: size_content
width: 800 #240
align: CENTER
pad_all: 0
border_width: 0
bg_color: 0xFFFFFF
widgets:
- meter: # Clock face
height: 400 #220
width: 400 #220
align: center
bg_opa: TRANSP
text_color: 0x000000
scales:
- ticks: # minutes scale
width: 1
count: 61
length: 10
color: 0x000000
range_from: 0
range_to: 60
angle_range: 360
rotation: 270
indicators:
- line:
id: minute_hand
width: 3
color: 0xa6a6a6
r_mod: -4
value: 0
- ticks: # hours scale
width: 1
count: 12
length: 1
major:
stride: 1
width: 4
length: 8
color: 0xC0C0C0
label_gap: 12
angle_range: 330
rotation: 300
range_from: 1
range_to: 12
- indicators:
- line:
id: hour_hand
width: 5
color: 0xa6a6a6
r_mod: -30
value: 0
angle_range: 360
rotation: 270
range_from: 0
range_to: 720
time:
- platform: homeassistant
id: time_comp
interval:
- interval: 30s
then:
if:
condition:
time.has_time:
then:
- script.execute: time_update
script:
- id: time_update
then:
- lvgl.indicator.update:
id: minute_hand
value: !lambda |-
return id(time_comp).now().minute;
- lvgl.indicator.update:
id: hour_hand
value: !lambda |-
auto now = id(time_comp).now();
return std::fmod(now.hour, 12) * 60 + now.minute;