KrisKasprzak
Well-known member
All,
I just bought a large 3.5" display that works fine with the ILI9488_t3 library (using my Teensy 3.2). I'm trying to get it working with the XPT2048_Touchscreen library, the display works but not touch capability. I'm using shared SPI pins. Here's what works and doesn't work
Display
https://www.amazon.com/gp/product/B07W84SX8K/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1
I realize the display drive listed on the web page says ILI9486--but trying that driver did not work with shared pins with the XPT2048
2.8" TFT with ILI9488 + XPT2048_Touchscreen using shared SPI bus works fine
3.5" TFT with ILI9488 + XPT2048_Touchscreen using shared SPI bus does not work
3.5" TFT with ILI9488 + UTourch using separate SPI pins for the UTouch library works fine
I really want to get this 3.5" TFT with ILI9488 + XPT2048_Touchscreen using shared SPI bus working as I need to minimize pin usage.
Anyone have experience with this setup? Here's my code
Thanks in advance
I just bought a large 3.5" display that works fine with the ILI9488_t3 library (using my Teensy 3.2). I'm trying to get it working with the XPT2048_Touchscreen library, the display works but not touch capability. I'm using shared SPI pins. Here's what works and doesn't work
Display
https://www.amazon.com/gp/product/B07W84SX8K/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1
I realize the display drive listed on the web page says ILI9486--but trying that driver did not work with shared pins with the XPT2048
2.8" TFT with ILI9488 + XPT2048_Touchscreen using shared SPI bus works fine
3.5" TFT with ILI9488 + XPT2048_Touchscreen using shared SPI bus does not work
3.5" TFT with ILI9488 + UTourch using separate SPI pins for the UTouch library works fine
I really want to get this 3.5" TFT with ILI9488 + XPT2048_Touchscreen using shared SPI bus working as I need to minimize pin usage.
Anyone have experience with this setup? Here's my code
Thanks in advance
Code:
#include <SPI.h>
#include "ILI9488_t3.h"
#include <XPT2046_Touchscreen.h>
#define CS_PIN 5
#define TIRQ_PIN 8
#define TFT_DC 2
#define TFT_CS 9
XPT2046_Touchscreen ts(CS_PIN, TIRQ_PIN);
ILI9488_t3 tft = ILI9488_t3(&SPI, TFT_CS, TFT_DC, 7);
void setup() {
Serial.begin(38400);
SPI.begin();
pinMode(TIRQ_PIN, INPUT);
pinMode(CS_PIN, OUTPUT);
pinMode(TFT_DC, INPUT);
pinMode(TFT_CS, INPUT);
ts.begin();
ts.setRotation(1);
tft.begin();
tft.setRotation( 1 );
tft.fillScreen(ILI9488_BLACK);
while (!Serial);
tft.setTextColor(ILI9488_YELLOW);
tft.setCursor(10, 100);
tft.print("waiting for Serial Monitor");
delay(1000);
}
void loop() {
if (ts.tirqTouched()) {
if (ts.touched()) {
TS_Point p = ts.getPoint();
Serial.print(p.x);
Serial.print(", ");
Serial.println(p.y);
delay(30);
}
}
}