Comments (19)
seems like the touch work but there is big offset between where i touch and it react
from lv_port_esp32.
if i touch top left i get x=320, y=239, if i touch top right i get x= 4, y=240, if i touch bottom left i get x=320, y=-416 (note: it is negative 416), if i touch bottom right i get x=2, y=-235
seems like need calibration, could you please help
from lv_port_esp32.
It seems you just need to swap the x coordinate. You can do it easily here: https://github.com/littlevgl/esp32_ili9341/blob/master/drv/xpt2046.c#L95
x = 320-x;
if( x < 0) x = 0;
if(x > 319) x = 319;
last_x = x;
from lv_port_esp32.
with that correction i get the following result
if i touch top left i get x=0, y=239, if i touch top right i get x= 320, y=240, if i touch bottom left i get x=0, y=-416 (note: it is negative 416), if i touch bottom right i get x=320, y=-293
here where i added:
/*Normalize Data*/
x = x >> 3;
y = y >> 3;
xpt2046_corr(&x, &y);
xpt2046_avg(&x, &y);
x = 320-x;
if( x < 0) x = 0;
if(x > 319) x = 319;
last_x = x;
//last_x = x;
last_y = y;
from lv_port_esp32.
more accurate data using pen for touch
if i touch top left i get x=0, y=239, if i touch top right i get x= 320, y=240, if i touch bottom left i get x=0, y=-416 (note: it is negative 416), if i touch bottom right i get x=320, y=-416
from lv_port_esp32.
I see. It really still need to be calibrated.
The calibration values are here:
https://github.com/littlevgl/esp32_ili9341/blob/master/drv/xpt2046.h#L27-L32
You should try to set the MIN coordinates to 0 and MAX to 4096 to disable calibration, check the coordinates and write them as calibration values.
I forget that here you can also invert the X and/or Y coordinates if required. So the previous hack is not required.
from lv_port_esp32.
ok, if i do min=0 and max 4096 i get teh followings
#define XPT2046_X_MIN 39
#define XPT2046_Y_MIN 21
#define XPT2046_X_MAX 271
#define XPT2046_Y_MAX 226
but when i put them in my code it doesn't work still i also tried the followings but no success
#define XPT2046_X_MIN 390
#define XPT2046_Y_MIN 210
#define XPT2046_X_MAX 2710
#define XPT2046_Y_MAX 2260
Note, X invert need to be 0
thanks for all your help
from lv_port_esp32.
What was the problem with the first version?
from lv_port_esp32.
ok i ran it again with 0 and 4096, here are the numbers,
bottom left x=38, y=21
top left x=38, y=211
top right x=250, y=226
bottom right x= 272, y=29
if i enter these numbers in my code and compile i get the followings
#define XPT2046_X_MIN 38
#define XPT2046_Y_MIN 21
#define XPT2046_X_MAX 272
#define XPT2046_Y_MAX 226
i get
bottom left x=379, y=-4118
top left x=378, y=-333
top right x=4334, y=-33
bottom right x= 5024, y=-4081
which make no sense
from lv_port_esp32.
I have no idea. The correction happens here: https://github.com/littlevgl/esp32_ili9341/blob/master/drv/xpt2046.c#L116
With the parameters, you provided it should work. You can debug it using printf
s to see where the miscalculation happens.
from lv_port_esp32.
i can't figure out what is going on, is it possible to recommend me a display that works with this code.
thanks,
from lv_port_esp32.
i set the invert for Y to 1 and i believe this is where the problem is, it is creating a negative number for Y
#if XPT2046_Y_INV != 0
(*y) = XPT2046_VER_RES - (*y);
from lv_port_esp32.
top left should be 0,0 or bottom left ?
from lv_port_esp32.
top left should be 0,0 or bottom left ?
Top-left should be (0,0).
i can't figure out what is going on
You should printf
the raw and corrected data step by step to where the problem occurs.
is it possible to recommend me a display that works with this code.
Resistive TPs might be different even for the same product type.
from lv_port_esp32.
This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from lv_port_esp32.
I also noticed the touch isn't working, in my case when i touch the screen from right to left the red dots appear from top to bottom, when i touch the screen from bottom to top the red dots appears from right to left.
I haven't tried to log the input device output, is there a 'easy' way to do it?
Regards
from lv_port_esp32.
@C47D Use printf
or something similar inside the indev_read
function.
from lv_port_esp32.
Thanks, i will take a look at it.
from lv_port_esp32.
This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from lv_port_esp32.
Related Issues (20)
- Cannot build project with LVGL as component HOT 1
- SPI display drivers do not play nice with other spi devices
- esp32-s3 invalid dma channel HOT 1
- Portrait mode of demos doesn't display correctly
- The link to the forum when you write a PR/issue is incorrect HOT 1
- build with esp-idf-4.4.3 fails HOT 1
- failed to run idf.py menuconfig HOT 3
- updated LVGL+squareline studio+ ESP32 HOT 2
- Demo on older esp-wrover-kit board ( not v4.1) HOT 2
- Display not showing the correct windows while running this example HOT 2
- Sunton ESP32-8048S070 board HOT 8
- How can I add my own components to the project
- Unable to compile on esp-idf version 5.0 HOT 4
- undefined reference to `lv_obj_set_scroll_propagation'
- Cant turn off LV_USE_FLEX
- Horizontal scrolling HOT 4
- fatal error: Arduino_H7_Video.h: No such file or directory
- ESP32C3 - non-LVGL task (temp reading) causes TFT display to go blank and stay blank on second run of task HOT 1
- ssd1306 driver
- ssd1306
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lv_port_esp32.