Portrait orientation for touch #2293
Replies: 1 comment 3 replies
-
You need to calibrate the screen in the rotation you will use. To do this run the Touch_calibrate sketch with the serial monitor window open and set to 115200 baud. When the calibration is complete the calibration parameters will be sent to the serial monitor window. You then need to cut and paste those parameters into the lvgl sketch in the setup() section and call the setTouch calibrate function. For example:
Then touches will then correspond to the correct area of the screen. Different screens have different touch threshold values. the 600 is the threshold value, pressure values above this identify a touch event. Typically the low quality resisitance based screens are less sensitive at the corners so the value may need to be adjusted. You can see the raw (uncalibrated) x,y and touch pressure (z value) if you run the TFT_eSPI library diagnostic example "Test_Touch_Controller" and look at the serial monitor window output. Check the sensitivity in ALL corners and set the threshold just below the minimum. Too low and noise will trigger a false touch. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I just started working with this excellent library and I'm impressed! Great work!
I've been trying out the Squareline Studio/LVGL solution which offers direct compatibility with the TFT_eSPI library.
I created a 240w by 320h design which displays great, yet the touch coordinates seem to be incorrect. The screen DOES react yet the touch parameters seem to be set for a landscape or another mode.
Could this be a setting I don't have correct within this code?
Curious if I need to alter the touchX and touchY values?
Also, what the "600" number designate.
Thank you for any help!
Beta Was this translation helpful? Give feedback.
All reactions