Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion examples/touchscreendemo/touchscreendemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);

void setup(void) {
Serial.begin(9600);

// 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) {
Expand Down
7 changes: 6 additions & 1 deletion examples/touchscreendemoshield/touchscreendemoshield.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);

void setup(void) {
Serial.begin(9600);

// 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) {
Expand Down