Closed AlexanderTonn closed 8 months ago
Touch IRQ will not work for some reason with this code. Wiring is definitely correct
constexpr static uint8_t TOUCH_IRQ = 2; // Touch Interrupt
constexpr static uint8_t TOUCH_CS = 3; // Touch Chip Select
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
XPT2046_Touchscreen touch(TOUCH_CS, TOUCH_IRQ);
// Detecting touch
if (touch.tirqTouched())
{
if(touch.touched())
{
TS_Point touchPoint = touch.getPoint();
touchPoint.x = map(touchPoint.x, TOUCH_X_MIN, TOUCH_X_MAX, tft.width(), 0);
touchPoint.y = map(touchPoint.y, TOUCH_Y_MIN, TOUCH_Y_MAX, 0, tft.height());
Serial.print("(x: ");
Serial.print(touchPoint.x);
Serial.print(")");
Serial.print("(y: ");
Serial.print(touchPoint.y);
Serial.println(")");
Serial.print("Touch Pressure: ");
Serial.println(touchPoint.z);
detectTouch(touchPoint.x, touchPoint.y, byPageId);
}
}
:rocket: Please describe your feature request
:pencil2: Describe the solution you'd like
:pushpin: Describe alternatives you've considered
Additional context