Skip to content

Commit

Permalink
Fixed touchscreen offset
Browse files Browse the repository at this point in the history
- added parameters for touchscree input range to _touch_instance
  • Loading branch information
CoretechR committed Dec 24, 2024
1 parent fb0d414 commit d882d2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Platformio/hardware/ESP32/boardtest/main_boardtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ class LGFX : public lgfx::LGFX_Device
cfg.pin_sda = SDA;
cfg.pin_scl = SCL;
cfg.freq = 400000;
cfg.x_min = 0;
cfg.x_max = screenWidth-1;
cfg.y_min = 0;
cfg.y_max = screenHeight-1;
_touch_instance.config(cfg);
_panel_instance.setTouch(&_touch_instance);
}
Expand Down
4 changes: 4 additions & 0 deletions Platformio/hardware/ESP32/tft_hal_esp32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ LGFX::LGFX(void) {
cfg.pin_sda = SDA_GPIO;
cfg.pin_scl = SCL_GPIO;
cfg.freq = 400000;
cfg.x_min = 0;
cfg.x_max = SCR_WIDTH-1;
cfg.y_min = 0;
cfg.y_max = SCR_HEIGHT-1;
_touch_instance.config(cfg);
_panel_instance.setTouch(&_touch_instance);
}
Expand Down

0 comments on commit d882d2e

Please sign in to comment.