Skip to content

Commit

Permalink
Touchscreen calibration and coordinates updated
Browse files Browse the repository at this point in the history
Updated calibration to new syntax and fixed touch coordinates to match pixels.
https://esphome.io/components/touchscreen/xpt2046.html?highlight=xpt2046#
  • Loading branch information
wuergezwerg authored and TheNitek committed May 11, 2024
1 parent a3c80c7 commit 9075694
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Examples/ESPHome/7-ExtendedTouchDemo/yellowtft1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ display:
spi_id: tft
cs_pin: GPIO15
dc_pin: GPIO2
rotation: 90
transform:
swap_xy: true
dimensions:
width: 320
height: 240
lambda: |-
it.fill(id(Color::BLACK));
it.filled_circle(80, 120, 60, id(ha_blue));
Expand All @@ -240,12 +244,13 @@ touchscreen:
interrupt_pin: GPIO36
update_interval: 50ms
threshold: 400
calibration_x_min: 3860
calibration_x_max: 280
calibration_y_min: 340
calibration_y_max: 3860
calibration:
x_min: 180
x_max: 3800
y_min: 240
y_max: 3860
transform:
swap_xy: false
swap_xy: true
# When the display is touched, turn on the backlight,
# store that we had a recent touch, and update the UI
on_touch:
Expand All @@ -264,4 +269,4 @@ sensor:
unit_of_measurement: "Signal %"
id: wifi_signal_pct
update_interval: 60s
entity_category: "diagnostic"
entity_category: "diagnostic"

0 comments on commit 9075694

Please sign in to comment.