ieee488:
Your code displays a black screen. Then if you press in a specific spot, the LCD is suppose to turn all red?
And it doesn't?
It is a black background with a white rectangle and a button, if i press the button the background should change to a red one with different text.
david_prentice:
There is some confusion over which screen you have.I suspect it is a Mcufriend-style Shield. The Touch pins are shared with the TFT. So you must always restore the Analog pins after any call to the Touch e.g.
TSPoint p = ts.getPoint(); //Get touch point
pinMode(YP, OUTPUT);
pinMode(XM, OUTPUT);
It is possible that YM, XP are on 8, 9. It is more common to be on 6, 7. You do not need the Adafruit_SPITFT headers. You have a regular parallel Mcufriend shield. Use a genuine Adafruit_TFTLCD library from Adafruit (or MCUFRIEND_kbv) David.
This worked beautifully, thanks a lot this post can be closed.
PS: for anyone wondering what screen it was, here is the link: Velleman IO for Arduino VMA412: 2.8 INCH TOUCH SCREEN FOR UNO/MEGA DEVELOPMENT BOARD – Velleman – Wholesaler and developer of electronics