Skip to content

XPT2046 touch with parallel display? #895

Answered by Bodmer
randyjanzen asked this question in Q&A - Touch
Discussion options

You must be logged in to vote

Hi, the "XPT2046_Touchscreen" librbray will work if you use the standard SPI pins, which on an ESP32 are pins 19 (MISO->T_DO), 23 (MOSI->T_DIN), 18 (SCK->T_CLK), you can then choose your own pin for the T_CS line. I have not tried it with the interrupt pin and that may not work with the ESP32. Here is an example that works with TFT_eSPI:

#include <XPT2046_Touchscreen.h>
#include <SPI.h>

#define CS_PIN  22
// 19 (MISO->T_DO), 23 (MOSI->T_DIN), 18 (SCK->T_CLK)

XPT2046_Touchscreen ts(CS_PIN);
//#define TIRQ_PIN  2
//XPT2046_Touchscreen ts(CS_PIN);  // Param 2 - NULL - No interrupts
//XPT2046_Touchscreen ts(CS_PIN, 255);  // Param 2 - 255 - No interrupts
//XPT2046_Touchscreen ts(CS_PIN, TIR…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Bodmer
Comment options

You must be logged in to vote
1 reply
@randyjanzen
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants