Skip to content

Conversation

@ars9
Copy link

@ars9 ars9 commented Nov 1, 2025

This example demonstrates how to automatically apply the correct touch calibration data for all four display rotations using the TFT_eSPI library.

The code shows how to:

  • Store four sets of touch calibration data (one for each rotation)
  • Automatically load the correct calibration when tft.setRotation() changes
  • Keep touch alignment consistent with the display orientation

Key Benefits

It is fully compatible with ESP32 modules using the XPT2046 touch controller. This example helps users quickly understand how to handle touch input across multiple screen rotations without manually recalibrating or modifying the User_Setup.h file each time.

Tested on:

  • ESP32-32E Display Module (E32R35T)
  • ST7796 display (HSPI)
  • XPT2046 touch controller (HSPI)
  • TFT_eSPI library v2.5.34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant