I have a tiny program included that prints hello world to the screen and then gets a touch screen point. I will later send that point x & y to the Serial Monitor. The code below works fine but when you un-comment the line //p = ts.getPoint(); the screen blanks out.
Why does getting the touch screen point blank the screen?
#include <TouchScreen.h>
#include <MCUFRIEND_kbv.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
MCUFRIEND_kbv tft;
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
TSPoint p;
void setup()
{
Serial.begin(9600);
tft.begin();
tft.setRotation(135);
tft.fillScreen(0x0000);
tft.setTextColor(0xfe00, 0x0000);
tft.setTextSize(2);
}
void loop()
{
tft.setCursor(10, 10);
tft.print("Hello World");
//p = ts.getPoint();
}