Problem with the orientation of the touch sensor relative to the display itself.
Thank you so much for the project!
- When assembling the ESP32-DIV on a breadboard using pre-made modules, a problem arises with the incorrect operation of the display touch sensor. Chinese display manufacturers can install the touch sensor in any orientation, so touch inputs can be mirrored both horizontally and vertically (in my case, I press a button on the right, but the left menu item is triggered). The problem is easily solved by swapping the values of the variables in the Touchscreen.h file. Take the value of the TS_MIN_ variable and put it into the TS_MAX_ variable, and put TS_MAX_ into TS_MIN_. But the whole trouble is that this will only change the behavior in the main menu. It won't work in submenus because hardcoded values are used there instead of the variables. In my files ESP32-DIV.ino, bluetooth.cpp, subghz.cpp, utils.cpp, wifi.cpp, I changed the lines:
x = ::map(p.x, 300, 3800, 0, SCREEN_WIDTH - 1);
y = ::map(p.y, 3800, 300, 0, SCREEN_HEIGHT - 1);
to
x = ::map(p.x, TS_MINX, TS_MAXX, 0, 239);
y = ::map(p.y, TS_MAXY, TS_MINY, 0, 319);
Now, when changes are made in the Touchscreen.h file, the touch sensor orientation changes everywhere. I suggest you make the same changes to the source code and add a note to the project description about adjusting the touch sensor orientation in this file.
- It also wouldn't hurt to add touch sensor calibration relative to the display. With the values 300 and 3800, touching the panel doesn't quite correspond to the information displayed on the screen. After some effort using DeepSeek, I created a small calibration program for this particular display instance. My results were:
#define TS_MINX 3944
#define TS_MAXX 232
#define TS_MINY 353
#define TS_MAXY 3944
can you upload bin file ? (Can you share by exporting the file?) My program (Arduino IDE) gives a lot of error. I cannot compile.
Hi! On the website vip-cxema.org, I described assembling the device from ready-made modules on a circuit board. It also describes how to prepare the Arduino IDE for compiling the project. The libraries and everything you need are available at the bottom of the article. The compiled files are also available. The article is in Russian, but I think it wouldn't be difficult to translate it into your language.
Is not working on 2.8tft display