Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Touch Panel not working using XPT2046_Touchscreen.h library

  1. #1
    Junior Member
    Join Date
    Oct 2019

    Touch Panel not working using XPT2046_Touchscreen.h library


    I am using a BuyDisplay 2.4" and 2.8" both using ILI9341 and xpt2046 for TP. I have tested both displays, connected to an Adafruit Metro M4 board using hardware SPI. Using the Adafruit_ILI9341.h & your XPT_Touchscreen.h library and using your TouchTest.ino example code. The displays alone work fine. Both TP's however do not work - the Arduino IDE serial monitor displays continuously (Pressure (z) = 4095, x = 0, y = 0). It seems to think the touch panel is always being touched but it is not. I have tried a second board Adafruit Grand Central M4 and it to exhibits the same issue with both display TP's. Your help would be greatly appreciated.

    [Display Signals] [Metro M4 Signals]
    D/C(SCL) ---- SCK
    LCD_SDI ---- MOSI
    LCD_SDO ---- MISO
    TP_CS ---- D8


  2. #2
    Senior Member
    Join Date
    Nov 2015
    Cold hollow VT
    You need to use both sets of SPI pins on the display in parallel. Check out the data sheets for the display for their pin assignments.

    Also there are pins to use as a CS for the resistive touch screen. Look at the Adafruit touch_color example for additional pins used.

  3. #3
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    As @grease_ligthing mentioned, many of their displays have different pins setup to do SPI, one for the display and one that does the other things, like touch, like SD, or ...

    Suggest in cases like that, that you give a link to which display you are using and configuration. Example I have a couple of different Buy display RA8875 displays, which some have resistive touch, others have capacitive touch. Some hook up through main connector others don't...

    Also maybe show photo of your wiring with explanation (as some of us may not know Metro M4's wiring...) and maybe a short sketch that shows what is failing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts