I just finished a project and the LCD (3.5" TFT LCD) has been working all the time.
Couple days go by and now that I want to use it, the TFT LCD doesn't respond to touching.
Looked at what coordinates it read when touching it and it only reads on value on the x-axis (1023) and y-axis works as normal.
See pic: Screenshot by Lightshot
Code handling the touch readings:
#include <LCDWIKI_GUI.h> //Core graphics library
#include <LCDWIKI_KBV.h> //Hardware-specific library
#include <stdint.h>
#include <string.h>
#include "TouchScreen.h"
#define YP A1 // must be an analog pin, use "An" notation!
#define XM A2 // must be an analog pin, use "An" notation!
#define YM 7 // can be a digital pin
#define XP 6 // can be a digital pin
#define MINPRESSURE 5
#define MAXPRESSURE 2000
#define TS_MINX 176
#define TS_MINY 176
#define TS_MAXX 918
#define TS_MAXY 953
LCDWIKI_KBV mylcd(ILI9486, A3, A2, A1, A0, A4); //model,cs,cd,wr,rd,reset
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
void setup(){
mylcd.Init_LCD(); //initialize lcd
mylcd.Set_Rotation(2);
Serial.begin(9600);
}
void loop(){
digitalWrite(13, HIGH);
// a point object holds x y and z coordinates
TSPoint p = ts.getPoint();
digitalWrite(13, LOW);
pinMode(YP, OUTPUT);
pinMode(XM, OUTPUT);
p.x = map(p.x, TS_MAXX, TS_MINX, 320, 0);
p.y = map(p.y, TS_MAXY, TS_MINY, 480, 0);
// 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);
}
}
Tried running this demo sketch from the library that simply prints the x and y-coordinates and it read this when I didn't touch the screen.
Pic: Screenshot by Lightshot
This makes me think I may have damaged the hardware/screen, if it reads a constant preassure when I'm not touching it.
Does someone have any guess as to what this might be? I've tried other forums and no one knows, getting desperate.