diff --git a/platformio.ini b/platformio.ini index e269b69..0659501 100644 --- a/platformio.ini +++ b/platformio.ini @@ -73,3 +73,10 @@ build_flags = -DILI9341_2_DRIVER -DSTASSID=\"FRITZ!Box7362SL\" -DSTAPSK=\"BorisundEva2007\" + +[env:cydalm] +build_flags = + ${env.build_flags} + -DILI9341_2_DRIVER + -DSTASSID=\"WLAN-7QHHAK\" + -DSTAPSK=\"3557919930817586\" diff --git a/src/main.cpp b/src/main.cpp index ef77a60..e4a1043 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -49,7 +49,7 @@ SPIClass spi2 = SPIClass(VSPI); SPIClass mySpi = SPIClass(VSPI); -#include +#include #include #include #include @@ -270,7 +270,7 @@ void setup() { Serial.println(ssid); WiFi.begin(ssid, password); Versuche = 0; - while (WiFi.status() != WL_CONNECTED) { + while ((WiFi.status() != WL_CONNECTED) ^ (Versuche >= WiFiError)) { delay(500); Serial.print("."); Versuche += 1; @@ -283,13 +283,21 @@ void setup() { tft.invertDisplay(a % 2); delay(500); } - WiFi.disconnect(); - ESP.restart(); + /* WiFi.disconnect(); + ESP.restart(); */ + } + else { + tft.invertDisplay(false); + tft.fillScreen(TFT_BLACK); + tft.setTextColor(TFT_WHITE, TFT_BLACK); + tft.drawCentreString(" Kein WLAN ! ", 160, 110, fontNum = 4); + delay(500); } } // Print local IP address and start web server + tft.invertDisplay(false); tft.fillScreen(TFT_BLACK); Serial.println(""); Serial.println("WiFi connected."); @@ -612,7 +620,14 @@ void Menue(){ } } - + if((touch.y >= 15) && (touch.y <= 30)){ + if((touch.x >= 270) && (touch.x <= 290)){ + deleteFile(SD, "/daten.csv"); + writeFile(SD, "/daten.csv", "Zeit;Temperatur;Feuchtigkeit\n"); + NoTouchScreen(touch); + zurueck = false; + } + } if((touch.y >= 15) && (touch.y <= 30)){ if((touch.x >= 15) && (touch.x <= 30)){ NoTouchScreen(touch);