mcufriend 320 x 480 calibration problem

I used UTFT and URTouch library, both drivers ili9481 and 9486 work

I am using calibration program which came with the URTouch library

Each time it gives me different values for CAL_X and CAL_Y

only like 1/4 of the screen responds any other area I touch shows y as 0 or 319 and only half of the screen would change x from 0 to 480, the other half shows x as 0.

I did the calibration like 20 times and I cannot get the whole screen to work.

Observe the raw values from each calibration point e.g. print value on Serial Terminal.

Do they make sense?
I suspect that URTouch gives you a simple example to print raw values on Serial.

David.

I am using Serial.print(x) and Serial.print(y)

to see where it comes out

looks to me like I cannot place the buttons any place I want

y will show 319 from bottom up, then I have very narrow strip in the middle where the values will change from 319 to 0, then it is O from middle up.

x will change half the screen from 0 to 480, then other half it shows 0

does not look like there is anything I can do about it, I have calibrated so many times, it does respond but I have only part of the screen for buttons.

No, URTouch does not come with any raw example. Try this. You should see raw values like 800 and 3600 for x, y. This will show whether the Touch Controller is wired in Portrait or Landscape mode.

#include <URTouch.h>

URTouch  myTouch( 6, 5, 4, 3, 2);

void setup()
{
    Serial.begin(9600);
    Serial.println("Hello URTouch_raw");
    myTouch.InitTouch();
    myTouch.setPrecision(PREC_HI);
}

void loop()
{
    long x, y;

    while (myTouch.dataAvailable() == true)
    {
        myTouch.read();
        x = myTouch.TP_X;  //use raw value
        y = myTouch.TP_Y;  //use raw value
        Serial.println("TP_X=" + String(x) + " TP_Y=" + String(y));
        delay(100);
    }
}

Of course you could just run the Calibration sketch and paste the results to your message.

The getX() and getY() methods convert the raw TP_X, TP_Y values into pixel coordinates.

David.