So basically, i have recently bought an 1.8inch TFT resistive touchscreen of aliexpress. And i cannot find any example for this exact model anywhere online. I managed to get the screen part working but not the touch. Here's the link: https://www.aliexpress.com/item/1005004897896357.html?spm=a2g0o.order_list.order_list_main.61.3a77180200yDEW
And thanks in advance to anyone whos willing to help
You probably connected the device incorrectly.
However, to be able to help you, it's always worth posting the code and schematic.
Screen & Touch are separate breakouts:
You need to look around the Internet for an Arduino library to deal with the resistive touch signals:
I'd start with Adafruit or Sparkfun.
I have done a preliminary with 3 pages of results...
Search · org:adafruit touch · GitHub
General warning to all forum members:
Please check online or drop the part seller an eMail and inquire about Arduino support libraries before you purchase.
There is lots of activity created by users purchasing and then asking the forum to resolve their dilemma for libraries or wiring configuration.
If you do not know what you are doing, then both Adafruit, Sparkfun, and others fully support their products with tutorials, schematics, and libraries... so, buy from companies that want you to be successful.
Another way to search:
T_IRQ + T_D0 + T_DIN + T_CS + T_CLK at DuckDuckGo
The touch panel can be connected to the SPI bus, T_IRQ and T_CS to two digital pin of the MCU. In this case I have it connected to a teensy 4.1. T-IRQ is tied to pin 2 and T_CS to pin 5.
The library that you can use is this: XPT2046_Touchscreen
The mapping of the relative position of the touchpad (x,y) depends on the calibration rotation. In the example there are these two functions:
x = map(p.x, 201, 3950, 0, 160); //ST7735 1.8", rotation 1
y = map(p.y, 3850, 340, 0, 128); //ST7735 1.8", rotation 1
Depending on the library you are using for the ST7735 screen, you will only have to adapt the occasional instruction for the so-called touch panel functions. In my case I used the ST7735_t3.h library for teensy 4.1
ST7735_T3_Touchtest.zip (4.9 KB)
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.