-
Notifications
You must be signed in to change notification settings - Fork 48
XPT2046, x-axis inverted after calibration #325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
yes as a matter of fact you can... import touch_cal_data
touch_cal = TouchCalData('My Display')
indev = xpt2046.XPT2046(touch_dev, touch_cal=touch_cal)
if not indev.is_calibrated:
indev.calibrate()
touch_cal.mirrorX = not touch_cal.mirrorX
touch_cal.save() only perform the calibration with the rotation set to zero. If you set it to any other rotation the numbers are going to get all mixed up resulting in the coordinates mapping to off display areas. |
Many thanks! Can I also do this in the board config? |
??? |
I mean, are there some settings in the board config, that would define this mirroring automatically at build time? |
Oh, and I forgot: How do I rotate the screen properly after the calibration? |
Ok, found it myself. I actually have to adapt the mirroring to the display angle, for lv.DISPLAY_ROTATION._90 this would be |
Describe the bug
Calibration runs with screen orientation 0°, but afterwards the x-axis of the touch screen is inverted, meaning when touching an object on the right side of the screen, the left side is instead selected, and vice versa. The y-axis is fine. Can I configure this somehow?
When trying to calibrate with other orientations, the calibration points appear off the screen.
When changing the orientation after calibration, the touch is all over the place.
The display driver is an ILI9341, screen is TFT 320x240.
Expected behavior
Both axis being configured right.
**Exact make and model number of the MCU that you are compiling for or the firmware is running on. **
For ESP32 MCU's The PSRAM and FLASH SPI type, quad SPI or octal SPI.
I need to know the OS and OS version of the machine that compiled the binary. If using a VM then I need to know the OS and OS version the VM is running. (WSL == VM)
Build Command
The text was updated successfully, but these errors were encountered: