LCD touch ILI9341, screen working no touch.

donperryjm

Well-known member
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?
 
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 [URL="https://github.com/PaulStoffregen/XPT2046_Touchscreen"]XPT2046_Touchscreen library[/URL].
 
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
 
Thanks. Working now. I suggest that Paul may place a link to that folder right below the pin specification on the product page. Thanks!
 
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.
 
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.
 
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?

screenshot.jpg
 
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.
 
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.
 
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:
Back
Top