Looking for a ESP32 TouchScreen Library
Looking for a ESP32 TouchScreen Library
Hello friends of the ESP32
This is working for the ESP32, but I could not find a Lib to use the Touchscreen.
https://github.com/MartyMacGyver/ESP32_Adafruit_ILI9341
Does someone know a Library working Touchscreen Lib for the ESP32.
This is working for the ESP32, but I could not find a Lib to use the Touchscreen.
https://github.com/MartyMacGyver/ESP32_Adafruit_ILI9341
Does someone know a Library working Touchscreen Lib for the ESP32.
Re: Looking for a ESP32 TouchScreen Library
#include <XPT2046_Touchscreen.h>
#include <SPI.h>
#define CS_PIN 8
// MOSI=11, MISO=12, SCK=13
//XPT2046_Touchscreen ts(CS_PIN);
#define TIRQ_PIN 2
//XPT2046_Touchscreen ts(CS_PIN); // Param 2 - NULL - No interrupts
//XPT2046_Touchscreen ts(CS_PIN, 255); // Param 2 - 255 - No interrupts
XPT2046_Touchscreen ts(CS_PIN, TIRQ_PIN); // Param 2 - Touch IRQ Pin - interrupt enabled polling
void setup() {
Serial.begin(38400);
ts.begin();
ts.setRotation(1);
while (!Serial && (millis() <= 1000));
}
void loop() {
if (ts.touched()) {
TS_Point p = ts.getPoint();
Serial.print("Pressure = ");
Serial.print(p.z);
Serial.print(", x = ");
Serial.print(p.x);
Serial.print(", y = ");
Serial.print(p.y);
delay(30);
Serial.println();
}
}
Thank you
I can compile this but I don't knew yet, if is working, I write this down later.
#include <SPI.h>
#define CS_PIN 8
// MOSI=11, MISO=12, SCK=13
//XPT2046_Touchscreen ts(CS_PIN);
#define TIRQ_PIN 2
//XPT2046_Touchscreen ts(CS_PIN); // Param 2 - NULL - No interrupts
//XPT2046_Touchscreen ts(CS_PIN, 255); // Param 2 - 255 - No interrupts
XPT2046_Touchscreen ts(CS_PIN, TIRQ_PIN); // Param 2 - Touch IRQ Pin - interrupt enabled polling
void setup() {
Serial.begin(38400);
ts.begin();
ts.setRotation(1);
while (!Serial && (millis() <= 1000));
}
void loop() {
if (ts.touched()) {
TS_Point p = ts.getPoint();
Serial.print("Pressure = ");
Serial.print(p.z);
Serial.print(", x = ");
Serial.print(p.x);
Serial.print(", y = ");
Serial.print(p.y);
delay(30);
Serial.println();
}
}
Thank you
I can compile this but I don't knew yet, if is working, I write this down later.
Re: Looking for a ESP32 TouchScreen Library
What a pitty it does not work
Re: Looking for a ESP32 TouchScreen Library
Fear is the mind killer.......
GameR the DIY iot gaming device that does more......
https://github.com/Duhjoker/GameR-Iot_ESP
GameR the DIY iot gaming device that does more......
https://github.com/Duhjoker/GameR-Iot_ESP
Re: Looking for a ESP32 TouchScreen Library
I have the same question: how to get the touchscreen work with my ESP32? I read the above link but I don't understand how to connect the touchscreen. Can anyone help me? Thank youDuhjoker wrote:Try this......
https://github.com/adafruit/Adafruit_IL ... hpaint.ino
Re: Looking for a ESP32 TouchScreen Library
I noticed on some boards there is an empty space with traces going to touchpad pins.
F.ex. this one: 2.4" 240x320 SPI TFT LCD
I wonder if I could just buy a touchscreen IC and just solder it there because seems like it is just missing to reduce the costs.
Anyone tried that maybe?
F.ex. this one: 2.4" 240x320 SPI TFT LCD
I wonder if I could just buy a touchscreen IC and just solder it there because seems like it is just missing to reduce the costs.
Anyone tried that maybe?
Re: Looking for a ESP32 TouchScreen Library
I found a solution that works. I use the TFT_eSPI library for the display and XPT2046_Touchscreenfor the touch.
TFT_eSPI defines the pins in a setup file, here is what I used:and
TFT_eSPI defines the pins in a setup file, here is what I used:
Code: Select all
// For ESP32 Dev board (only tested with ILI9341 display)
// The hardware SPI can be mapped to any pins
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 5 // Chip select control pin (15)
#define TFT_DC 2 // Data Command control pin
#define TFT_RST 4 // Reset pin (could connect to RST pin)
Code: Select all
#define SPI_FREQUENCY 40000000 // Maximum to use SPIFFS
// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY 2500000
Re: Looking for a ESP32 TouchScreen Library
Hi,
Has anyone got this working lately? Also, based on the pins, I suppose that the CLK, MISO, MOSI pins would remain common for both LCD and Touch while the CS/SS will be different and independent for LCD and Touch? Would be great if someone can share a correct and tested pinout?
I'm working with a 2.8" LCD with touch screen (ILI9341 chipset) and having a little trouble integrating it, hence call for help.
Regards,
Deepak
Has anyone got this working lately? Also, based on the pins, I suppose that the CLK, MISO, MOSI pins would remain common for both LCD and Touch while the CS/SS will be different and independent for LCD and Touch? Would be great if someone can share a correct and tested pinout?
I'm working with a 2.8" LCD with touch screen (ILI9341 chipset) and having a little trouble integrating it, hence call for help.
Regards,
Deepak
Re: Looking for a ESP32 TouchScreen Library
Looks like the TFT_eSPI library is now updated and supports ESP32 as well for use of touch.
https://forum.arduino.cc/index.php?topic=616515.0
https://github.com/Bodmer/TFT_eSPI
Regards,
Deepak
https://forum.arduino.cc/index.php?topic=616515.0
https://github.com/Bodmer/TFT_eSPI
Regards,
Deepak
Who is online
Users browsing this forum: No registered users and 50 guests