Skip to content

Commit c0b730a

Browse files
authored
Merge pull request #46 from caternuson/iss39
Force 10 bit ADC
2 parents 237a419 + ebbbedf commit c0b730a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

examples/touchscreendemo/touchscreendemo.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,17 @@ TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
1717

1818
void setup(void) {
1919
Serial.begin(9600);
20+
21+
// 10 bit ADC values are expected by the touch library.
22+
// If touch locations seem incorrect, try uncommenting
23+
// this line to force 10 bit resolution:
24+
// analogReadResolution(10);
2025
}
2126

2227
void loop(void) {
2328
// a point object holds x y and z coordinates
2429
TSPoint p = ts.getPoint();
25-
30+
2631
// we have some minimum pressure we consider 'valid'
2732
// pressure of 0 means no pressing!
2833
if (p.z > ts.pressureThreshhold) {

examples/touchscreendemoshield/touchscreendemoshield.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,17 @@ TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
2121

2222
void setup(void) {
2323
Serial.begin(9600);
24+
25+
// 10 bit ADC values are expected by the touch library.
26+
// If touch locations seem incorrect, try uncommenting
27+
// this line to force 10 bit resolution:
28+
// analogReadResolution(10);
2429
}
2530

2631
void loop(void) {
2732
// a point object holds x y and z coordinates
2833
TSPoint p = ts.getPoint();
29-
34+
3035
// we have some minimum pressure we consider 'valid'
3136
// pressure of 0 means no pressing!
3237
if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {

0 commit comments

Comments
 (0)