Using The ILI9341 TFT & XPT2046 Touch With ESP32 & Arduino

Resistive or Capacitive Touch? Well you might ask what kinds of applications can these be used in? Although there might be a preference towards a capacitive screen over the former, there are some applications where a resistive touch screen will give the end-user easier operation/maintenance. Like for example, in medical apps a user might not be able to remove gloves in order to use the device or where a touch-stylus and resistive screen is much quicker.

2.8 " TFT (SPI touch)

These are popular and cheap displays but there are a lot of confusing information about these devices. I got mine from amazon.ca - https://www.amazon.ca/gp/product/B087C3PP9G/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

I am using an esp32 WROOM 32 dev kit, but you can use any esp32 as long as you configure the pins correctly. If you notice that I am using two separate SPI buses, one for the display and one for the touch interface. At first I tried to run both controllers off the same spi (as most of the instructions out there seem to implement) but was not successful. Once they were independent of each other, the system stabilized.

XPT2046 Touch Controller see - https://github.com/PaulStoffregen/XPT2046_Touchscreen

Breadboarded test with BMP280

Menu system...

keyboards...

My first attempt at a keyboard!

UPDATE Feb. 14, 2021

1. Moved the project from the breadboard and gave it a home!

2. Adding new code to address scanning for keys

3. Moved around files, created a Helper.h library

4. Implemented Interrupt-Driven system to manage keys - experimental.

The next step is to add I/O. First onboard the display PCB, a BME280

1 / 4From breadboard to prototype 1 / 7ESP32 WROOM microcontroller on a 2560 proto board

I had an MPU6050 so I added it to the project. Next I will add an oximeter, a MLX90640(software added 2/24/21) and SD card to the SPI bus(later). also on the horizon - a blue-tooth interface to an android device... stay tuned.

Tag » Arduino Xpt2046 Touch Screen