Hello,
Recently I bought the 2.8" TFT Touch Shield for Arduino -
http://www.adafruit.com/products/376-. I like it and it works fine.
Now I am trying to create a menu and print the buttons in the screen, but unfortunately, the TFT doesn't print what I push.
In the example I atach the code, I am trying to print a "7". I've checked with the Serial.print that I get correctly the number...but for some reason the TFT can't print on the screen.
I attach the code:
oid loop()
{
Point p = ts.getPoint();
if (p.z > MINPRESSURE && p.z < MAXPRESSURE) { // Si apreto un boto
p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0); // Recalculo les posicions X i Y
p.y = map(p.y, TS_MINY, TS_MAXY, tft.height(), 0);
if (p.y >H1 && p.y<H5 ) {
if (p.x>X1 && p.x<X6){
if (p.x>X1 && p.x<X2){
if (p.y>H1 && p.y<H2){
tft.print(7);
}
}
---
I have tried using:
tft.print(7);
tft-.print("7");
tft.println("7");
But anything happens, I don't know why. If I try to print it in other place of the code, it works with no problems, but the problem is that I want only that the number 7 appears when I push the key I've drawn in the screen.
I guess that I have to put the "tft.print" command in other place of the code, but where? Any idea to sync printings and touches to screen?
Thanks,
A.