esphome/tests/components/qr_code/test.esp8266.yaml
2024-03-28 12:56:26 +13:00

25 lines
574 B
YAML

spi:
- id: spi_main_lcd
clk_pin: 14
mosi_pin: 13
miso_pin: 12
display:
- platform: ili9xxx
id: main_lcd
model: ili9342
cs_pin: 5
dc_pin: 15
reset_pin: 16
lambda: |-
// Draw a QR code in the center of the screen
auto scale = 2;
auto size = id(homepage_qr).get_size() * scale;
auto x = (it.get_width() / 2) - (size / 2);
auto y = (it.get_height() / 2) - (size / 2);
it.qr_code(x, y, id(homepage_qr), Color(255,255,255), scale);
qr_code:
- id: homepage_qr
value: https://esphome.io/index.html