-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathesp32-2432s028.yaml
200 lines (173 loc) · 3.74 KB
/
esp32-2432s028.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
substitutions:
NODE: "Dev Screen"
TEXT_TITLE: "CatsLair"
FONT_SIZE_CLOCK: "48"
FONT_SIZE_ICONS: "44"
FONT_SIZE_BIG: "26"
FONT_SIZE_TINY: "14"
<<: !include includes/fonts_subs.yaml
<<: !include includes/common_network.yaml
packages:
ha: github://jaredquinn/esphome-wx/packages/ha_sensors.yaml
internal: github://jaredquinn/esphome-wx/packages/internal_sensors.yaml
fonts: github://jaredquinn/esphome-wx/packages/fonts.yaml
dimmer: github://jaredquinn/esphome-wx/packages/auto_dim.yaml
esphome:
name: screen2
includes:
- includes/display_functions.h
- includes/auto_dim.h
on_boot:
then:
- lambda: |-
uint8_t val = 0x40;
uint8_t len = 1;
my_display->send_command(esphome::ili9xxx::ILI9XXX_MADCTL, &val, len);
esp32:
board: esp32dev
framework:
type: arduino
logger:
level: INFO
globals:
- id: page
type: int
initial_value: "1"
spi:
- clk_pin: GPIO14
mosi_pin: GPIO13
miso_pin: GPIO12
id: bus_tft
- clk_pin: GPIO25
mosi_pin: GPIO32
miso_pin: GPIO39
id: bus_ts
i2c:
- sda: GPIO27
scl: GPIO22
scan: true
id: bus_a
touchscreen:
platform: xpt2046
interrupt_pin: 36
cs_pin: 33
display: my_display
id: my_touchscreen
spi_id: bus_ts
update_interval: 50ms
threshold: 400
calibration_x_min: 3775
calibration_x_max: 404
calibration_y_min: 3587
calibration_y_max: 289
transform:
swap_xy: true
on_touch:
- lambda: |-
ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
touch.x,
touch.y,
touch.x_raw,
touch.y_raw
);
output:
# Internal LED
- platform: ledc
pin: GPIO21
id: backlight_pin
# Other LEDs
- platform: ledc
id: output_red
pin: GPIO4
inverted: true
- platform: ledc
id: output_green
pin: GPIO16
inverted: true
- platform: ledc
id: output_blue
pin: GPIO17
inverted: true
light:
- platform: monochromatic
output: backlight_pin
name: "${NODE} Display Backlight"
id: back_light
restore_mode: ALWAYS_ON
- platform: rgb
name: LED
id: led
red: output_red
green: output_green
blue: output_blue
restore_mode: ALWAYS_OFF
effects:
- pulse:
name: "Fast Pulse"
transition_length: 0.5s
update_interval: 0.5s
min_brightness: 0%
max_brightness: 100%
- strobe:
name: "Strobe"
colors:
- state: true
brightness: 100%
red: 100%
green: 90%
blue: 0%
duration: 500ms
- state: false
duration: 250ms
- state: true
brightness: 100%
red: 0%
green: 100%
blue: 0%
duration: 500ms
sensor:
- platform: adc
pin: 34
name: "${NODE} Light Level"
id: internal_ldr
update_interval: 5s
on_value:
- lambda: change_adc(1.08-x);
binary_sensor:
- platform: touchscreen
id: bottom_A
name: "${NODE} Touch A"
x_min: 1
x_max: 80
y_min: 200
y_max: 339
on_press:
- lambda: id(page) = 1;
- platform: touchscreen
id: bottom_B
name: "${NODE} Touch B"
x_min: 80
x_max: 160
y_min: 200
y_max: 339
on_press:
- lambda: id(page) = 2;
- platform: touchscreen
id: bottom_C
name: "${NODE} Touch C"
x_min: 160
x_max: 240
y_min: 200
y_max: 339
on_press:
- lambda: id(page) = 3;
display:
- platform: ili9xxx
id: my_display
spi_id: bus_tft
rotation: 90
dc_pin: GPIO2
cs_pin: GPIO15
model: TFT_2.4R
data_rate: 40MHz
<<: !include includes/display_lambda.yaml