I currently have a BuyDisplay 800x480 TFT display with a resistive touch screen attached to a shield. Screen is a SSD1963 and touch screen is attached to a XPT2046 chip. The shield is attached to an Arduino Mega.
The shield s is set for hardware SPI.
The screen and touch screen work fine via UTFT and URTouch, and MCUFRIEND_kbv with XPT2046_TouchScreen or URTouch. Calibration routines on URTouch and XPT2046_TouchScreen work fine.
I wanted to try and use TFT_Touchscreen with MCUFRIEND_kbv.
The calibration example is designed to be use with TFT_ILI9341 library which is not compatiable with my TFT.
So I rewrote the TFT_Touch_calibrate_v2 example to use MCUFRIEND_kbv and a 800x480 screen
In Portrait setup, the example works fine. Coordinates reported are right and when you put the stylus on the screen, the green cross is right underneath and follows the stylus exactly.
In Landscape mode there is a problem. The coordinates are spot on after the calibration is run with the TL corner reading 4x15, TR corner reading 782x18, BL corner reading 2x478 and BR corner reading 791x464 when you test using the stylus, however the green cross is a quarter of a screen away horizontally. The calibration values reported are very close to each other no matter how many times you run is.
With the following cal values (337,3852,572,3662,800,480,0) entered in the sketch, after running the calibration routine the stylus and green cross go in opposite directions both vertically and horizontally
If I change the last value to "1" in the sketch cal value, the cal routine reports
(317, 3843, 82, 3595, 800, 480, 1) and the green cross is now half a screen away horizontally and it will follow the stylus vertically but in the opposite direction horizontally
As I would like to use my screen in a landscape direction and use TFT_Touch, I would like to get this calibration spot on.
I'd like to post the code but I keep getting warnings about ~~~ or </> formatting??