2024-12-1500 Display gedreht.

This commit is contained in:
hans-jurgen 2024-12-15 23:51:23 +01:00
parent 7f61c47bf6
commit ff068df920

View File

@ -67,6 +67,8 @@ void zeigeZeit(tm localTime, int x, int y);
void drawMenue(int32_t xs, int32_t sy);
void Menue();
void zeige_IP(int x, int y);
void NoTouchScreen(TouchPoint touch_1);
void listDir(fs::FS &fs, const char * dirname, uint8_t levels) {
Serial.printf("Listing directory: %s\n", dirname);
@ -241,7 +243,7 @@ void setup() {
// Start the tft display and set it to black
tft.init();
tft.setRotation(1); //This is the display in landscape
tft.setRotation(3); //This is the display in landscape
// Clear the screen before writing to it
tft.fillScreen(TFT_BLACK);
@ -413,10 +415,13 @@ void loop() {
if (touch.zRaw != 0){
printTouchToSerial2(touch.x, touch.y, touch.xRaw);
if((touch.x >= 275) && (touch.y >= 210)){
Serial.printf(" Gefunden bei: %i : %i : %i \n", touch.y, touch.x, touch.zRaw);
if((touch.y >= 15) && (touch.y <= 30)){
if((touch.x >= 15) && (touch.x <= 30)){
//Serial.printf(" Gefunden bei: %i : %i : %i \n", touch.y, touch.x, touch.zRaw);
NoTouchScreen(touch);
Menue();
}
}
}
getNTPtime(10);
@ -519,9 +524,9 @@ void Menue(){
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.println("Interval der Messwert-\nspeicherung in Minuten.");
if (touch.zRaw != 0){
//printTouchToSerial2(touch.x, touch.y, touch.xRaw);
if(((touch.x >= 15) && (touch.x <= 55)) && ((touch.y >= 95) && (touch.y <= 125))){
printTouchToSerial2(touch.x, touch.y, touch.xRaw);
if ((touch.y >= 110) && (touch.y <= 145)){
if((touch.x >= 245) && (touch.x <= 280)){
Serial.printf(" Gefunden bei 1: %i : %i : %i \n", touch.y, touch.x, touch.zRaw);
tft.drawRoundRect(11,91,38,38,5,TFT_GOLD);
tft.drawRoundRect(12,92,36,36,5,TFT_GOLD);
@ -533,7 +538,7 @@ void Menue(){
interval = 1;
}
if(((touch.x >= 65) && (touch.x <= 95)) && ((touch.y >= 95) && (touch.y <= 125))){
if((touch.x >= 200) && (touch.x <= 245)){
Serial.printf(" Gefunden bei 2: %i : %i : %i \n", touch.y, touch.x, touch.zRaw);
tft.drawRoundRect(61,91,38,38,5,TFT_GOLD);
tft.drawRoundRect(62,92,36,36,5,TFT_GOLD);
@ -544,7 +549,7 @@ void Menue(){
tft.drawRoundRect(63,93,34,34,5,TFT_BLACK);
interval = 5;
}
if(((touch.x >= 110) && (touch.x <= 140)) && ((touch.y >= 95) && (touch.y <= 125))){
if((touch.x >= 165) && (touch.x <= 195)){
Serial.printf(" Gefunden bei 3: %i : %i : %i \n", touch.y, touch.x, touch.zRaw);
tft.drawRoundRect(111,91,38,38,5,TFT_GOLD);
tft.drawRoundRect(112,92,36,36,5,TFT_GOLD);
@ -555,7 +560,7 @@ void Menue(){
tft.drawRoundRect(113,93,34,34,5,TFT_BLACK);
interval = 10;
}
if(((touch.x >= 150) && (touch.x <= 195)) && ((touch.y >= 95) && (touch.y <= 125))){
if((touch.x >= 120) && (touch.x <= 150)){
Serial.printf(" Gefunden bei 4: %i : %i : %i \n", touch.y, touch.x, touch.zRaw);
tft.drawRoundRect(161,91,38,38,5,TFT_GOLD);
tft.drawRoundRect(162,92,36,36,5,TFT_GOLD);
@ -566,7 +571,7 @@ void Menue(){
tft.drawRoundRect(163,93,34,34,5,TFT_BLACK);
interval = 30;
}
if(((touch.x >= 200) && (touch.x <= 230)) && ((touch.y >= 95) && (touch.y <= 125))){
if((touch.x >= 75) && (touch.x <= 100)){
Serial.printf(" Gefunden bei 5: %i : %i : %i \n", touch.y, touch.x, touch.zRaw);
tft.drawRoundRect(211,91,38,38,5,TFT_GOLD);
tft.drawRoundRect(212,92,36,36,5,TFT_GOLD);
@ -577,11 +582,16 @@ void Menue(){
tft.drawRoundRect(213,93,34,34,5,TFT_BLACK);
interval = 60;
}
if((touch.x >= 275) && (touch.y >= 210)){
Serial.printf(" Gefunden bei: %i : %i : %i \n", touch.y, touch.x, touch.zRaw);
}
if((touch.y >= 15) && (touch.y <= 30)){
if((touch.x >= 15) && (touch.x <= 30)){
NoTouchScreen(touch);
zurueck = false;
}
}
}
tft.drawRoundRect(10,90,40,40,5,TFT_GREEN);
tft.drawRoundRect(60,90,40,40,5,TFT_GREEN);
tft.drawRoundRect(110,90,40,40,5,TFT_GREEN);
@ -609,3 +619,10 @@ void Menue(){
tft.println(WiFi.localIP());
tft.setTextSize(1);
}
void NoTouchScreen(TouchPoint touch_1){
do{
delay(50);
//Serial.printf(" Gefunden bei --------->: %i : %i : %i \n", touch_1.y, touch_1.x, touch_1.zRaw);
touch_1 = touchscreen.getTouch();
} while(touch_1.zRaw > 0);
}