Screen will not work/reload

Hello, people,

I have the following problem: I have on my Arduino MEGA in 2560 a touchscreen. I have downloaded to me the suitable Libarie and everything functions so far.

I have got the Demoscript and have changed a little. Everything functions, to turns white on the fact that the screen after the first one update and nichtmehr läd. The code goes on quite normally.

Excuse for my bad English. I speak myself German

#include <Adafruit_TFTLCD.h>
#include <Adafruit_GFX.h>
#include <TouchScreen.h>

// SCREEN
#define LCD_RESET A4
#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
Adafruit_TFTLCD Screen(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
uint16_t Indentifizierer = 0x9341;

// TOUCH
#define YP A2
#define XM A3
#define YM 8
#define XP 9
TouchScreen Touch = TouchScreen(XP, YP, XM, YM, 300);
uint16_t X = -1;
uint16_t Y = -1;

// FARBEN
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
#define ROZ 0xFD20
#define ROZ2 0xFBE0
#define GRI 0xBDF7

// PROGRAMM
uint16_t Menue = 1;

void setup(void)
{
Serial.begin(9600);
Screen.reset();
Screen.begin(Indentifizierer);
ScreenLaden();
}

void loop(void)
{
TSPoint p = Touch.getPoint();
if (p.z > Touch.pressureThreshhold)
{
if (Screen.getRotation() == 0)
{
X = (100 - (((p.y - 165) / 3.125) / 2.4)) * 2.4;
Y = (p.x - 175) / 2.421875;
}
else if (Screen.getRotation() == 2)
{
X = (p.y - 167) / 3.125;
Y = (100 - (((p.x - 182) / 2.421875) / 3.2)) * 3.2;
}
if ((Screen.getRotation() == 0 || Screen.getRotation() == 2 ) && (0 < X && X <= 240 && 0 < Y && Y <= 320))
{
CheckTouch();
}
}
}

void CheckTouch()
{
if ((207 <= X && X <= 239) && (1 <= Y && Y <= 33))
{
Serial.println(“TOUCH”);
if (Screen.getRotation() == 0)
{
Screen.setRotation(2);
ScreenAktualisieren();
}
else if (Screen.getRotation() == 2)
{
Screen.setRotation(0);
ScreenAktualisieren();
}
}
}

void ScreenLaden()
{
Screen.setRotation(0);
Screen.fillScreen(RED);
Screen.setCursor(50, 5);
Screen.setTextColor(BLACK);
Screen.setTextSize(3);
Screen.println(“Sky-Tool”);
Serial.println(“Geladen”);
}

void ScreenAktualisieren()
{
if (Menue == 1)
{
// Here it’s going to whitescreen!
Screen.fillScreen(RED);
Screen.setCursor(50, 5);
Screen.setTextColor(BLACK);
Screen.setTextSize(3);
Screen.println(“Sky-Tool”);
Serial.println(“Aktualisiert”);
}
}

I don’t know why it’s going to whitescreen! The demo works completly.

Here an example:

void rotateText() {
for (uint8_t i=0; i<4; i++) {
tft.fillScreen(BLACK);
tft.setCursor(0, 30);
tft.setTextColor(RED);
tft.setTextSize(1);
tft.println(“Hello World!”);
tft.setTextColor(YELLOW);
tft.setTextSize(2);
tft.println(“Hello World!”);
tft.setTextColor(GREEN);
tft.setTextSize(3);
tft.println(“Hello World!”);
tft.setTextColor(BLUE);
tft.setTextSize(4);
tft.print(1234.567);
delay(500);
tft.setRotation(tft.getRotation()+1);
}
}

Thank you for your help.

Everything functions, to turns white on the fact that the screen after the first one update and nichtmehr läd

I don’t understand this.

Excuse for my bad English. I speak myself German

Can you find someone to help with the English, or post in the German section?

I don’t know why it’s going to whitescreen! The demo works completly.

Can you post the demo code - in code tags, not quote tags?

You appear to be using A3 as both the CS (Chip Select) for the screen and XM on touch part. Could this cause a conflict ?

It looks like Google translate has not understood your German for it does not load anymore: nichtmehr läd