i am using these connections for enabling the touch control in my display . it has the resistive touch pins [xm,xp,ym,yp] . in this combo i used the tft_espi library and mcufriend_kbv was working only display it self not touch .
i had working on this for past few weeks with different solutions ...some times it will print the pressure on the serial monitor but nothing will print on the display. even some thing and also sometimes after dumping the code , when i touch the screen lines will print on the bottom of the screen .
so here my queries are,
- these pin connections are correct ? not ?
- those xm,xp,ym,yp are correct ?
- which libraries are best to use for this combo ?
- is there steps to be take for avoiding the conflicts [like ...10 adc resolution...etc] ?
You can pretty much use any of the pins unless they are used for anything else or are INPUT only. So as such your pin choice seems fine.
The same response, they seem fine
For the SPI i have used TFT_eSPI.h and the MCUfriend for the normal version that you have. That doesn't mean that those are the best options.
Since a couple of pins are shared between the Touchscreen and the TFT, you have to 'reset' the pinMode() of those pins after you read from the touchscreen, before you try and print the result to the TFT.
void ResetPins(){
pinMode(XM, OUTPUT); // reset the pins after use.
pinMode(YP, OUTPUT);
pinMode(XP, OUTPUT);
pinMode(YM, OUTPUT);
}
The examples show this as well if i am not mistaken.
There is a chance that your particular screen is being powered with 3.3v where 5v is more appropriate. Anyway, please share some of the coding attempts and issues with them, and please post a picture of you screen module (both sides) and a link to where you got it from.