Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void loop() {
- ido = timeClient.getFormattedTime();
- tizperc = (ido.substring(3,4));
- tizpercint= tizperc.toInt();
- if (tizpercint != temppercint) {
- timeClient.update();
- temppercint = tizpercint;
- Serial.println("ido frissitve");
- }
- Serial.println(ido);
- u8g2.clearBuffer();
- u8g2.setFont(u8g2_font_8x13_tr);
- u8g2.setDrawColor(1);
- u8g2.setFontPosTop();
- u8g2.setFontDirection(2);
- String ipString = WiFi.localIP().toString();
- u8g2.drawStr(127,31, (char *) ipString.c_str());
- u8g2.setFont(u8g2_font_10x20_tr);
- u8g2.drawStr(127,18, (char *) ido.c_str());
- u8g2.sendBuffer();
- if (ipString == "0.0.0.0") {
- Serial.println("Az IP cim rossz!");
- WiFi.disconnect();
- Serial.println("lecsatlakozva");
- delay(10000);
- WiFi.begin();
- while (WiFi.status() != WL_CONNECTED) {
- delay(500);
- Serial.print('.');
- }
- Serial.println("felcsatlakozva");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement