Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtouch_touch_setup() calibration in touch.h is incorrect #88

Open
gknops opened this issue Jan 7, 2024 · 0 comments
Open

xtouch_touch_setup() calibration in touch.h is incorrect #88

gknops opened this issue Jan 7, 2024 · 0 comments

Comments

@gknops
Copy link

gknops commented Jan 7, 2024

The calibration is performed by drawing crosses with their center inset 10px. However the calibration calculation incorrectly uses the width of the entire cross.

So around line 140 the code should be (40 replaced with 20, 20 replaced with 10):

        int16_t xDist = 320 - 20;
        int16_t yDist = 240 - 20;

        x_touch_touchConfig.xCalM = (float)xDist / (float)(x2 - x1);
        x_touch_touchConfig.xCalC = 10.0 - ((float)x1 * x_touch_touchConfig.xCalM);
        // y
        x_touch_touchConfig.yCalM = (float)yDist / (float)(y2 - y1);
        x_touch_touchConfig.yCalC = 10.0 - ((float)y1 * x_touch_touchConfig.yCalM);

        xtouch_saveTouchConfig(x_touch_touchConfig);

        loadScreen(-1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant