Hi arnovio and all...
I cant help you much, it sounds like your touch screen is broke like mine is too.
I put some built in debug info in mine to troubleshoot it, and enable/disable the touch function until I can replace it. Basically, my problem is it returns a touch value (p.z) = 4095 weather I touch it or not. When not touching it, the X & Y values fly all over the place. Result of my test without touching:
319 x -10 Pressure: 4095
275 x 95 Pressure: 4095
301 x 40 Pressure: 4095
284 x 124 Pressure: 4095
310 x 0 Pressure: 4093
318 x 5 Pressure: 4095
323 x 49 Pressure: 4095
363 x 43 Pressure: 4095
763 x -291 Pressure: 4095
304 x 10 Pressure: 4095
292 x 55 Pressure: 4095
260 x 49 Pressure: 4095
312 x 16 Pressure: 4098
320 x 0 Pressure: 4098
307 x -62 Pressure: 4095
295 x 65 Pressure: 4095
297 x 60 Pressure: 4095
313 x 15 Pressure: 4097
327 x 55 Pressure: 4095
if I touch:
basically you can see when I touched the corners:
320 x 64 Pressure: 4095
316 x 0 Pressure: 4095
292 x 57 Pressure: 4095
76 x 245 Pressure: 4095
584 x -151 Pressure: 4095
101 x 219 Pressure: 4095
554 x -120 Pressure: 4095
317 x 62 Pressure: 4095
360 x 20 Pressure: 4095
So what to do? Nothing. I detect a "different value" because they are all different. I was going to try to look for the values of x+y changing but that wont work. I will have to replace the screen. So I put an enable/disable function. Just replace the first part of loop to this:
void loop() {
#ifdef DEBUGTOUCH
if (touchController.isTouched(2500) && ENABLETOUCH) {
TS_Point p = touchController.getPoint();
Serial.print(p.y);
Serial.print(" x ");
Serial.print(p.x);
Serial.print(" Pressure: ");
Serial.println(p.z);
if (p.y < 80) {
//Jim took out because touch screen is broken
IS_STYLE_12HR = !IS_STYLE_12HR;
} else {
screen = (screen + 1) % screenCount;
}
}
#else
if (touchController.isTouched(500) && ENABLETOUCH) {
TS_Point p = touchController.getPoint();
Serial.print(p.y);
Serial.print(" x ");
Serial.print(p.x);
Serial.print(" Pressure: ");
Serial.println(p.z);
if (p.y < 80) {
//Jim took out because touch screen is broken
IS_STYLE_12HR = !IS_STYLE_12HR;
} else {
screen = (screen + 1) % screenCount;
}
}
#endif
gfx.fillBuffer(MINI_BLACK);
...
...
and add these two to settings.h:
#define ENABLETOUCH true
#define DEBUGTOUCH
after you open your serial monitor, touch it to see if your Z value changed. IF it stays the same value like mine, you are screwed like mine. I have no idea for a workaround, which is a shame because it partially works.
To add insult to injury, I ordered a second off Ebay. I accidentally ordered it without touch, so be careful because they make the EXACT screen with and without touch.
To turn off the touch, and make it display a steady screen so it's at lease usable, of course just change the define line you added to this
#define ENABLETOUCH false
when and if you get another, turn it back to true, and turn off the debug by just commenting this line:
//#define DEBUGTOUCH
Hope it can help you.
Best regards,
JimA