From 56c42868d2cda7a348d41e64d5339144ed603589 Mon Sep 17 00:00:00 2001 From: caternuson Date: Fri, 29 Aug 2025 06:29:28 -0700 Subject: [PATCH 1/2] force 10 bit ADC --- examples/touchscreendemo/touchscreendemo.ino | 3 +++ examples/touchscreendemoshield/touchscreendemoshield.ino | 3 +++ 2 files changed, 6 insertions(+) diff --git a/examples/touchscreendemo/touchscreendemo.ino b/examples/touchscreendemo/touchscreendemo.ino index bf883b3..9b3cb57 100644 --- a/examples/touchscreendemo/touchscreendemo.ino +++ b/examples/touchscreendemo/touchscreendemo.ino @@ -17,6 +17,9 @@ TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); void setup(void) { Serial.begin(9600); + + // make sure ADC values are expected 10 bit resolution + analogReadResolution(10); } void loop(void) { diff --git a/examples/touchscreendemoshield/touchscreendemoshield.ino b/examples/touchscreendemoshield/touchscreendemoshield.ino index edc6299..8f970f4 100644 --- a/examples/touchscreendemoshield/touchscreendemoshield.ino +++ b/examples/touchscreendemoshield/touchscreendemoshield.ino @@ -21,6 +21,9 @@ TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); void setup(void) { Serial.begin(9600); + + // make sure ADC values are expected 10 bit resolution + analogReadResolution(10); } void loop(void) { From ebbbedf0da5c9ffe3209c73fe87dc9ca421e532d Mon Sep 17 00:00:00 2001 From: caternuson Date: Fri, 29 Aug 2025 06:47:36 -0700 Subject: [PATCH 2/2] comment out --- examples/touchscreendemo/touchscreendemo.ino | 8 +++++--- examples/touchscreendemoshield/touchscreendemoshield.ino | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/touchscreendemo/touchscreendemo.ino b/examples/touchscreendemo/touchscreendemo.ino index 9b3cb57..1cbf3d3 100644 --- a/examples/touchscreendemo/touchscreendemo.ino +++ b/examples/touchscreendemo/touchscreendemo.ino @@ -18,14 +18,16 @@ TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); void setup(void) { Serial.begin(9600); - // make sure ADC values are expected 10 bit resolution - analogReadResolution(10); + // 10 bit ADC values are expected by the touch library. + // If touch locations seem incorrect, try uncommenting + // this line to force 10 bit resolution: + // analogReadResolution(10); } void loop(void) { // a point object holds x y and z coordinates TSPoint p = ts.getPoint(); - + // we have some minimum pressure we consider 'valid' // pressure of 0 means no pressing! if (p.z > ts.pressureThreshhold) { diff --git a/examples/touchscreendemoshield/touchscreendemoshield.ino b/examples/touchscreendemoshield/touchscreendemoshield.ino index 8f970f4..40e635a 100644 --- a/examples/touchscreendemoshield/touchscreendemoshield.ino +++ b/examples/touchscreendemoshield/touchscreendemoshield.ino @@ -22,14 +22,16 @@ TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); void setup(void) { Serial.begin(9600); - // make sure ADC values are expected 10 bit resolution - analogReadResolution(10); + // 10 bit ADC values are expected by the touch library. + // If touch locations seem incorrect, try uncommenting + // this line to force 10 bit resolution: + // analogReadResolution(10); } void loop(void) { // a point object holds x y and z coordinates TSPoint p = ts.getPoint(); - + // we have some minimum pressure we consider 'valid' // pressure of 0 means no pressing! if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {