Help Arduino Mega 2560 + 3.2" TFT LCD

The UTouch lIbrary in my view uses a slightly odd method ..

  1. I used a logic analyser to review the Texas Instrument chip used for the screen, this showed the best option seemed to be to attach the IRQ to a pin on arduino as an ege triggered interrupt. rather than use the polll techniues and read while low.

  2. The spec on the chip also highlighted that although its 12 bit resolution to ensure next value availability you should clear the buffer register by clocking 16 bits through, from memory the UTouch library only does 12

  3. You tend to get a ghosting interrupt generated at removal of touch which if your polling will cause extra invalid readings.

4 I run a moving average on data during a touch event.

Calibration is difficult on smaller displays if you google cailibrartion algorithms for TFT touch, the matrix solution always comes out best but

/// a.. On 3,2 its a bit overkill
// b. The maths is difficult to program

The UTouch Library solution is fair, but holding the pointer still whilst sampling for a series of locations I find difficult, my customers founmd impossible.

Rewrote the calibration to cycle defined points round screen to acieve am average Y for TOP, BOTTOM and average x for LEFT, RIGHT with that and some simple maths can scale any touch sample read to be position on screen

Currently can specify down to 8 x 8 Icon on screen and with stylas touch detecy position. With finger touch use 16 x 16 Icon

Happy coding