I've got a "LCD Display 4 Inch SPI Screen (Touchscreen) - 480x320 Resolution". I've installed libraries LCDWIKI_SPI and LCDWIKI_TOUCH. The examples all do what they are supposed to as far as what gets displayed on the screen.
The problem I'm having is with the touch functionality. Where I touch and where Arduino thinks I touch seem to be mirrored. Correct me if I'm wrong but I've concluded that there's no actual x and y pins for the resistive layer. I guess it's decoded on the board and then sent through the SPI.
One thing that is odd is that when I run the "touch_screen_calibration" sketch, it responds correctly to where I press over the moving target and the numbers that it displays on the screen are very close to what is in the cali_para.h file. So whatever method that's used to figure out the location of the touch is different between the calibration sketch and ALL of the touch examples....which is weird. Help me please?
Look at this case
You are wrong.
You have two connections for each of the X and Y connections. But if you swap them over you then have to change your calibration routine in the way described above.
No, I'm not wrong. This is an SPI interface. So by definition they've reduced the number of pins; i.e. you only have clock, data and some control stuff. The analog output of resistive layer does not directly come out of the TFT board---meaning you can't get at it with an ohm meter. There's an onboard ADC and the "touch" coordinates are transferred digitally. Anyway, I fixed it.
my_touch.TP_Set_Rotation(0);
I changed it to my_touch.TP_Set_Rotation(2);
Done.