Compare commits
3 Commits
20df16be9d
...
6491bd17b7
Author | SHA1 | Date | |
---|---|---|---|
6491bd17b7 | |||
3f15e6eb45 | |||
ff068df920 |
141
src/main.cpp
141
src/main.cpp
|
@ -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);
|
||||
|
@ -226,7 +228,7 @@ void testFileIO(fs::FS &fs, const char * path) {
|
|||
}
|
||||
|
||||
// ENDE TEST
|
||||
int WiFiError = 36;
|
||||
int WiFiError = 35;
|
||||
int Versuche;
|
||||
int interval;
|
||||
|
||||
|
@ -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,9 +415,12 @@ 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);
|
||||
Menue();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -519,67 +524,72 @@ 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);
|
||||
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);
|
||||
tft.drawRoundRect(13,93,34,34,5,TFT_GOLD);
|
||||
delay(1000);
|
||||
tft.drawRoundRect(11,91,38,38,5,TFT_BLACK);
|
||||
tft.drawRoundRect(12,92,36,36,5,TFT_BLACK);
|
||||
tft.drawRoundRect(13,93,34,34,5,TFT_BLACK);
|
||||
interval = 1;
|
||||
}
|
||||
|
||||
if(((touch.x >= 15) && (touch.x <= 55)) && ((touch.y >= 95) && (touch.y <= 125))){
|
||||
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);
|
||||
tft.drawRoundRect(13,93,34,34,5,TFT_GOLD);
|
||||
delay(1000);
|
||||
tft.drawRoundRect(11,91,38,38,5,TFT_BLACK);
|
||||
tft.drawRoundRect(12,92,36,36,5,TFT_BLACK);
|
||||
tft.drawRoundRect(13,93,34,34,5,TFT_BLACK);
|
||||
interval = 1;
|
||||
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);
|
||||
tft.drawRoundRect(63,93,34,34,5,TFT_GOLD);
|
||||
delay(1000);
|
||||
tft.drawRoundRect(61,91,38,38,5,TFT_BLACK);
|
||||
tft.drawRoundRect(62,92,36,36,5,TFT_BLACK);
|
||||
tft.drawRoundRect(63,93,34,34,5,TFT_BLACK);
|
||||
interval = 5;
|
||||
}
|
||||
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);
|
||||
tft.drawRoundRect(113,93,34,34,5,TFT_GOLD);
|
||||
delay(1000);
|
||||
tft.drawRoundRect(111,91,38,38,5,TFT_BLACK);
|
||||
tft.drawRoundRect(112,92,36,36,5,TFT_BLACK);
|
||||
tft.drawRoundRect(113,93,34,34,5,TFT_BLACK);
|
||||
interval = 10;
|
||||
}
|
||||
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);
|
||||
tft.drawRoundRect(163,93,34,34,5,TFT_GOLD);
|
||||
delay(1000);
|
||||
tft.drawRoundRect(161,91,38,38,5,TFT_BLACK);
|
||||
tft.drawRoundRect(162,92,36,36,5,TFT_BLACK);
|
||||
tft.drawRoundRect(163,93,34,34,5,TFT_BLACK);
|
||||
interval = 30;
|
||||
}
|
||||
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);
|
||||
tft.drawRoundRect(213,93,34,34,5,TFT_GOLD);
|
||||
delay(1000);
|
||||
tft.drawRoundRect(211,91,38,38,5,TFT_BLACK);
|
||||
tft.drawRoundRect(212,92,36,36,5,TFT_BLACK);
|
||||
tft.drawRoundRect(213,93,34,34,5,TFT_BLACK);
|
||||
interval = 60;
|
||||
}
|
||||
}
|
||||
|
||||
if(((touch.x >= 65) && (touch.x <= 95)) && ((touch.y >= 95) && (touch.y <= 125))){
|
||||
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);
|
||||
tft.drawRoundRect(63,93,34,34,5,TFT_GOLD);
|
||||
delay(1000);
|
||||
tft.drawRoundRect(61,91,38,38,5,TFT_BLACK);
|
||||
tft.drawRoundRect(62,92,36,36,5,TFT_BLACK);
|
||||
tft.drawRoundRect(63,93,34,34,5,TFT_BLACK);
|
||||
interval = 5;
|
||||
}
|
||||
if(((touch.x >= 110) && (touch.x <= 140)) && ((touch.y >= 95) && (touch.y <= 125))){
|
||||
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);
|
||||
tft.drawRoundRect(113,93,34,34,5,TFT_GOLD);
|
||||
delay(1000);
|
||||
tft.drawRoundRect(111,91,38,38,5,TFT_BLACK);
|
||||
tft.drawRoundRect(112,92,36,36,5,TFT_BLACK);
|
||||
tft.drawRoundRect(113,93,34,34,5,TFT_BLACK);
|
||||
interval = 10;
|
||||
}
|
||||
if(((touch.x >= 150) && (touch.x <= 195)) && ((touch.y >= 95) && (touch.y <= 125))){
|
||||
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);
|
||||
tft.drawRoundRect(163,93,34,34,5,TFT_GOLD);
|
||||
delay(1000);
|
||||
tft.drawRoundRect(161,91,38,38,5,TFT_BLACK);
|
||||
tft.drawRoundRect(162,92,36,36,5,TFT_BLACK);
|
||||
tft.drawRoundRect(163,93,34,34,5,TFT_BLACK);
|
||||
interval = 30;
|
||||
}
|
||||
if(((touch.x >= 200) && (touch.x <= 230)) && ((touch.y >= 95) && (touch.y <= 125))){
|
||||
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);
|
||||
tft.drawRoundRect(213,93,34,34,5,TFT_GOLD);
|
||||
delay(1000);
|
||||
tft.drawRoundRect(211,91,38,38,5,TFT_BLACK);
|
||||
tft.drawRoundRect(212,92,36,36,5,TFT_BLACK);
|
||||
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);
|
||||
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user