3.5" resistive touch screen PRESSURE always zero

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Gerardus
 
Posts: 3
Joined: Tue Oct 06, 2015 3:00 pm

3.5" resistive touch screen PRESSURE always zero

Post by Gerardus »

I'am using the Adafruit 3.5" 320x480 Color TFT Touchscreen Breakout and the touchscreen is not reacting most of the time.

I use the touchscreendemoshield.ino to test the resistive touchscreen. The code checks for minimum pressure to draw the dot and the minimum pressure almost always reads 0.
if (p.z < MINPRESSURE || p.z > MAXPRESSURE) {
return;
}

If I change the minpressure value to 0 it is working and writes the dots at the good location on the screen.
Any idea how to solve this?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: 3.5" resistive touch screen PRESSURE always zero

Post by adafruit_support_mike »

Have you run the calibration routine from this page of the tutorial?

https://learn.adafruit.com/adafruit-pit ... alibration

User avatar
Gerardus
 
Posts: 3
Joined: Tue Oct 06, 2015 3:00 pm

Re: 3.5" resistive touch screen PRESSURE always zero

Post by Gerardus »

The calibration routine is for an Raspberry Pi and I am using an Arduino.

The following lines were written in code:
// 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);

I measured between X- an X+ = 255 Ohm
Between y- and Y+ = 620 Ohm
Between X and Y is infinite as expected.

I changed the 300 to 255 but no difference.

User avatar
Gerardus
 
Posts: 3
Joined: Tue Oct 06, 2015 3:00 pm

Re: 3.5" resistive touch screen PRESSURE always zero

Post by Gerardus »

Solved!

I powered the display from the Arduino nano and the output voltage dropped from 5V to 4V causing the pressure calculation to fail. Used an external power supply and this solved the problem.
Note: the display consumes 170mA

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: 3.5" resistive touch screen PRESSURE always zero

Post by adafruit_support_mike »

I clicked the wrong reference.. sorry for the confusion.

Glad to hear you found and fixed the real issue. Happy hacking!

User avatar
psyrax
 
Posts: 6
Joined: Thu Jan 14, 2016 11:40 am

Re: 3.5" resistive touch screen PRESSURE always zero

Post by psyrax »

So this is why it might not be working on an arduino micro? I'm having the same issue.

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

Return to “Arduino Shields from Adafruit”