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?
3.5" resistive touch screen PRESSURE always zero
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Gerardus
- Posts: 3
- Joined: Tue Oct 06, 2015 3:00 pm
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: 3.5" resistive touch screen PRESSURE always zero
Have you run the calibration routine from this page of the tutorial?
https://learn.adafruit.com/adafruit-pit ... alibration
https://learn.adafruit.com/adafruit-pit ... alibration
- Gerardus
- Posts: 3
- Joined: Tue Oct 06, 2015 3:00 pm
Re: 3.5" resistive touch screen PRESSURE always zero
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.
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.
- Gerardus
- Posts: 3
- Joined: Tue Oct 06, 2015 3:00 pm
Re: 3.5" resistive touch screen PRESSURE always zero
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
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
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: 3.5" resistive touch screen PRESSURE always zero
I clicked the wrong reference.. sorry for the confusion.
Glad to hear you found and fixed the real issue. Happy hacking!
Glad to hear you found and fixed the real issue. Happy hacking!
- psyrax
- Posts: 6
- Joined: Thu Jan 14, 2016 11:40 am
Re: 3.5" resistive touch screen PRESSURE always zero
So this is why it might not be working on an arduino micro? I'm having the same issue.
Please be positive and constructive with your questions and comments.