forked from shangjiazi/esp32_esphome_tft_espi_Parallel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-ili9486.yaml
101 lines (101 loc) · 2.39 KB
/
test-ili9486.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
esphome:
name: test-ili9486
friendly_name: test-ili9486
external_components:
- source: github://booroondook-eng/ILI9486_ESP32_ESPHome_TFT_eSPI_8bit_Parallel
components: [mar3501]
esp32:
board: wemos_d1_uno32
framework:
type: arduino
logger:
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "Test-ILI9486 Fallback Hotspot"
password: !secret wifi_password
captive_portal:
sensor:
time:
- platform: homeassistant
id: homeassistant_time
font:
- file: "gfonts://Roboto"
id: roboto30
size: 30
- file: "gfonts://Roboto"
id: roboto22
size: 22
color:
- id: RED
red: 100%
green: 0%
blue: 0%
- id: GREEN
red: 0%
green: 100%
blue: 0%
- id: BLUE
red: 0%
green: 0%
blue: 100%
- id: WHITE
red: 100%
green: 100%
blue: 100%
- id: YELLOW
red: 100%
green: 100%
blue: 0%
- id: BLACK
red: 0%
green: 0%
blue: 0%
display:
- platform: mar3501
id: disp
update_interval: 1s
rotation: 90
user_build_flags:
- TFT_PARALLEL_8_BIT
- ILI9486_DRIVER
- LOAD_GLCD=1
- LOAD_FONT2=1
- LOAD_FONT4=1
- LOAD_FONT6=1
- LOAD_FONT7=1
- LOAD_FONT8=1
- LOAD_GFXFF=1
- SMOOTH_FONT=1
# - SPI_FREQUENCY=27000000
# - SPI_READ_FREQUENCY=20000000
# - SPI_TOUCH_FREQUENCY=2500000
- TFT_CS=33
- TFT_DC=15
- TFT_RST=32
- TFT_WR=4
- TFT_RD=2
- TFT_D0=12
- TFT_D1=13
- TFT_D2=26
- TFT_D3=25
- TFT_D4=17
- TFT_D5=16
- TFT_D6=27
- TFT_D7=14
- USER_SETUP_LOADED=1
# - INIT_SEQUENCE_3
# - CGRAM_OFFSET
# - TFT_INVERSION_ON=1
- TFT_WIDTH=320
- TFT_HEIGHT=480
lambda: |-
it.fill(BLACK);
it.printf(it.get_width()/2, 12, id(roboto22), Color(YELLOW), TextAlign::CENTER, id(homeassistant_time).now().strftime("%d.%m.%Y").c_str());
it.printf(it.get_width()/2, 40, id(roboto30), Color(WHITE), TextAlign::CENTER, id(homeassistant_time).now().strftime("%X").c_str());
it.printf(it.get_width()/2, 70, id(roboto30), Color(RED), TextAlign::CENTER, "RED red RED");
it.printf(it.get_width()/2, 100, id(roboto30), Color(GREEN), TextAlign::CENTER, "GREEN green GREEN");
it.printf(it.get_width()/2, 130, id(roboto30), Color(BLUE), TextAlign::CENTER, "BLUE blue BLUE");