I bought a 3.5" TFT LCD Touch Screen from KUMAN last year for my project but could not get it to work so I tossed it aside and used something else. This time, I decided to use it for my new project (Snack Vending Machine) and I have ran into this thread from Yakopra and followed every steps to run all the tests and download all the necessary libraries for the LCD. But, there was a problem when I ran the "diagnose_Touchpins.ino", I did not get the same result as the poster did. This is what I got on the Serial Monitor:
Making all control and bus pins INPUT_PULLUP
Typical 30k Analog pullup with corresponding pin
would read low when digital is written LOW
e.g. reads ~25 for 300R x direction
e.g. reads ~30 for 500R Y direction
Testing : (A3, D9) = 31
and it just stopped at that. I was wondering if there was something wrong with my LCD. All of the other examples seem to run fine. I have not tried running the ShowBMP.ino examples yet since I have no intention of using it anyways. This is my first time using this LCD Touch Screen so I have no prior experience over this. Any helps would be very much appreciated.
Thank you for your response. Assuming that I had a cracked glass screen, would the X coordinate be 0 when I ran the "touchscreendemo.ino" example? Here is the codes of that example that I downloaded from:
// Touch screen library with X Y and Z (pressure) readings as well
// as oversampling to avoid 'bouncing'
// This demo code returns raw readings, public domain
#include <stdint.h>
#include "TouchScreen.h"
#define YP A2 // must be an analog pin, use "An" notation!
#define XM A3 // must be an analog pin, use "An" notation!
#define YM 8 // can be a digital pin
#define XP 9 // can be a digital pin
// 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);
void setup(void) {
Serial.begin(9600);
}
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) {
Serial.print("X = "); Serial.print(p.x);
Serial.print("\tY = "); Serial.print(p.y);
Serial.print("\tPressure = "); Serial.println(p.z);
}
delay(100);
}
Here is the output on Serial Monitor:
X = 967 Y = 1023 Pressure = 849
X = 965 Y = 1023 Pressure = 848
X = 961 Y = 1023 Pressure = 844
X = 966 Y = 1023 Pressure = 849
X = 956 Y = 1023 Pressure = 746
X = 956 Y = 1023 Pressure = 746
X = 967 Y = 1023 Pressure = 566
X = 968 Y = 1023 Pressure = 756
X = 968 Y = 1023 Pressure = 756
X = 961 Y = 1023 Pressure = 844
X = 960 Y = 1023 Pressure = 750
As I noticed, the value of X changed a little bit but the Y value stayed constant and the pressure values were quite high (in my opinion) when I used the stylish to touch random spot on the screen.
My question is: Is it the right code to test for my TFT LCD and what should I expect the output so that I know my LCD is working properly? Also, I do not really know how to measure the resistance of the LCD using DMM. If you had any tutorials for that, I would really appreciate. Thanks again.
I measured the resistance between LCD_CS and LCD_D1 as 600 ohm and resistance between LCD_CD and LCD_D0 was 0. I also probed through A0-A3 with LCD_D0 - LCD_D7 and I did not get any readings except for LCD_CS and LCD_D1 as 600 ohm.
Does it mean that the touch screen feature of my LCD is broken? If so, is there any ways to fix it? Also, the resistance between LCD_CS and LCD_D1 was 600 ohm, which indicates something about the bad connection?