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

Thread: LCD touch ILI9341, screen working no touch.

  1. #1
    Senior Member
    Join Date
    Jan 2019
    Posts
    157

    LCD touch ILI9341, screen working no touch.

    Hey guys, me again.

    I bought this touch screen display from PJRC.com
    and applied the code written here to a teensy 4.1

    the display seems to be working but i cannot get touch to work. I triple checked the jumper wires on the breadboard and they agree with the instruction showed here

    Not getting a touch response. Any ideas?

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,863
    That uses library #include "TouchScreen.h"

    That is not the one for the PJRC display.

    Use a sample from this library folder: github.com/PaulStoffregen/XPT2046_Touchscreen/tree/master/examples

    That uses library: #include <XPT2046_Touchscreen.h>

    Just looked and that is noted on product page as:
    Code:
    The XPT2046 touch controller can be read with this XPT2046_Touchscreen library.

  3. #3
    Senior Member
    Join Date
    Jan 2019
    Posts
    157
    I see this section in the code.
    What is the relationship between this snippet and the config on the PJRC page?
    Code:
    #define YP A2  // must be an analog pin, use "An" notation!
    #define XM A3  // must be an analog pin, use "An" notation!
    #define YM 5   // can be a digital pin
    #define XP 4   // can be a digital pin

  4. #4
    Senior Member
    Join Date
    Jan 2019
    Posts
    157
    Quote Originally Posted by defragster View Post
    That uses library #include "TouchScreen.h"

    That is not the one for the PJRC display.

    Use a sample from this library folder: github.com/PaulStoffregen/XPT2046_Touchscreen/tree/master/examples

    That uses library: #include <XPT2046_Touchscreen.h>

    Just looked and that is noted on product page as: The XPT2046 touch controller can be read with this XPT2046_Touchscreen library.
    OK just saw your reply

  5. #5
    Senior Member
    Join Date
    Jan 2019
    Posts
    157
    Thanks. Working now. I suggest that Paul may place a link to that folder right below the pin specification on the product page. Thanks!

  6. #6
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,863
    Quote Originally Posted by donperryjm View Post
    I see this section in the code.
    What is the relationship between this snippet and the config on the PJRC page?
    Code:
    #define YP A2  // must be an analog pin, use "An" notation!
    #define XM A3  // must be an analog pin, use "An" notation!
    #define YM 5   // can be a digital pin
    #define XP 4   // can be a digital pin
    The post seen should resolve your issue.

    To answer this - some Touch Screens present analog output to represent the touch position. The PJRC display has onboard logic to parse the analog values and present them instead over the SPI bus used for the Display data.

    Seeing that in the linked sample is how it was known to be wrong. ... that and the included library name.

  7. #7
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,863
    Quote Originally Posted by donperryjm View Post
    Thanks. Working now. I suggest that Paul may place a link to that folder right below the pin specification on the product page. Thanks!
    Good results Fast!

    Yes, that confusion has come up before where the display examples don't fit the PJRC display.

    @Paul might see this - but there is a 'Web-site-could-use-a-few-updates' edits needed thread - if posted there and a link to this thread it would help queue it until there is time for Paul's attention.

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    27,656
    Quote Originally Posted by donperryjm View Post
    I suggest that Paul may place a link to that folder right below the pin specification on the product page.
    Is this link not the appropriate place?

    Click image for larger version. 

Name:	screenshot.jpg 
Views:	17 
Size:	103.8 KB 
ID:	30331

  9. #9
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,863
    Quote Originally Posted by PaulStoffregen View Post
    Is this link not the appropriate place?

    ...
    Yes, I copied from that link in post #2 to resolve the problem ...

    It seems a bit distant {with two interposed lines} as it gets missed? And the examples for the prior linked display library include the Analog not SPI Touch.

  10. #10
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    27,656
    Any more specific suggestions on how I should rearrange the info on that page to make it clearer?

    Somehow I suspect @donperryjm's suggestion to move the link much farther down the page, to just after the pinout table in Connections, will only make it harder for most people to find.

  11. #11
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,863
    Easiest and maybe effective in some fashion - unless the included library examples were altered:

    Code:
    This 320x240 color TFT display is recommended for use with Teensy 3.2 to Teensy 4.1, for high resolution color graphics.
    
    It can be used with the Adafruit_ILI9341 library or Optimized ILI9341 library.
    It uses the XPT2046 touch controller that can be read with this XPT2046_Touchscreen library.
    
    ILI9341_t3 supports large high-res fonts. A library of additional fonts is available, as well as huge collection of Google fonts, and even more fonts here. There's also an alternate https://forum.pjrc.com/threads/39804-ILI9341-font-builder, in addition to ttf_to_ili9341.pl.
    
    Two alternate optimized libraries are available, from Frank B and KurtE.
    Last edited by defragster; 02-07-2023 at 04:05 AM. Reason: that

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    27,656
    Ok, I've rearranged the text on that page. I also added a "Software" heading.

    https://www.pjrc.com/store/display_ili9341_touch.html

    Hopefully having the first 2 blue links as the 2 required libraries, and then all the alternate stuff following, will make this easier.

  13. #13
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,863
    Quote Originally Posted by PaulStoffregen View Post
    Ok, I've rearranged the text on that page. I also added a "Software" heading.

    https://www.pjrc.com/store/display_ili9341_touch.html

    Hopefully having the first 2 blue links as the 2 required libraries, and then all the alternate stuff following, will make this easier.
    Hopefully ... Should be clearer with the localized link and avoid TLDR reference issues.

Posting Permissions

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