Touchscreen Sensitivity Questions

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Munque
 
Posts: 17
Joined: Fri Apr 12, 2019 11:51 pm

Touchscreen Sensitivity Questions

Post by Munque »

I'm working with this Touch screen - 3.7" and it seems to be insensitive. It works if you push hard enough, but that makes it sort of impractical to use. I was assuming a solution might be on the last line of the following code...

Code: Select all

#include "TouchScreen.h"
#define Yp A4 // must be an analog pin, use "An" notation!
#define Xn A5 // must be an analog pin, use "An" notation!
#define Yn 14 // can be a digital pin
#define Xp 27 // can be a digital pin
TouchScreen ts = TouchScreen(Xp, Yp, Xn, Yn, 300);
My assumption was the 300 related to sensitivity, but so far no changes to that number have any effect.

Second possibility was here...

Code: Select all

void loop() {
	TSPoint p = ts.getPoint();
	if (p.z > ts.pressureThreshhold) {
		//Do something.
	}
}
I attempted to diminish the threshold as follows...

Code: Select all

void loop() {
	TSPoint p = ts.getPoint();
	if (p.z != 0) {
		//Do something.
	}
}
So far the device remains stubbornly insensitive.
I'm trying to determine if it's there's a coding solution or we're just confronting a limitation of the touchscreen device itself.

User avatar
mikeysklar
 
Posts: 14181
Joined: Mon Aug 01, 2016 8:10 pm

Re: Touchscreen Sensitivity Questions

Post by mikeysklar »

Did you try using a multimeter to measure the resistance between X+ and X-? Our example assumes a 300 ohm resistance, but your display might have a different value.
// For better pressure precision, we need to know the resistance
// between X+ and X- Use any multimeter to read it
// For the one we're using, its 300 ohms across the X plate
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
https://github.com/adafruit/Adafruit_To ... endemo.ino

Did you experiment further with the MINPRESSURE readings?
// we have some minimum pressure we consider 'valid'
// pressure of 0 means no pressing!
if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {
Serial.print("X = "); Serial.print(p.x);
Serial.print("\tY = "); Serial.print(p.y);
Serial.print("\tPressure = "); Serial.println(p.z);
https://github.com/adafruit/Adafruit_To ... shield.ino

User avatar
Munque
 
Posts: 17
Joined: Fri Apr 12, 2019 11:51 pm

Re: Touchscreen Sensitivity Questions

Post by Munque »

mikeysklar wrote:Did you try using a multimeter to measure the resistance between X+ and X-?
Yes 650Ω, but setting

Code: Select all

TouchScreen ts = TouchScreen(Xp, Yp, Xn, Yn, 650);[code] had no affect.  I tried a range of numbers, from 100 to 2000 and never experienced a difference in performance.

[quote="mikeysklar"]Did you experiment further with the MINPRESSURE readings?[/quote]
Rather than play with settings I just monitor them in the Arduino Serial Monitor where they generally range from 0 to -500, never positive, but they sometimes spike between -2000 & -4000 and occasionally -8000
It is never possible to get a response at all until putting a significant amount of pressure -- far more pressure (easily 10X the pressure) you'd put on an iPhone.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”