color:
- id: my_blue
red: 0%
green: 0%
blue: 100%
spi:
id: spihwd
clk_pin: 2
mosi_pin: 3
font:
- file: "gfonts://Roboto"
id: font_12
size: 12
display:
- platform: ili9xxx
id: lcd_display
model: st7789v
spi_id: spihwd
data_rate: 20MHz #oringal device uses 20mhz - 40 is default and works - does not work at 80mhz
# cs_pin: # 直接接地
dc_pin: 8
reset_pin: 9
spi_mode: MODE2 #since no cs pin default is mode0
dimensions:
width: 240
height: 240
offset_height: 0
offset_width: 0
invert_colors: true
# update_interval: never
# auto_clear_enabled: false
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));
it.strftime(5, 5, id(font_12), id(my_blue), TextAlign::TOP_LEFT, "%H:%M:%S", id(time_comp).now());
time:
- platform: sntp
id: time_comp
问题解决
主要是修改了这3个参数
dc_pin: 8
reset_pin: 9
spi_mode: MODE2
|