 		wifiFrame = wifiFrame + 1 % NUM_WIFI_FRAMES;
 	u8g2.drawXBM(SCREEN_WIDTH - 16, SCREEN_HEIGHT - 16, 16, 16, WIFI_FRAMES[wifiFrame]);
 	u8g2.sendBuffer();
+
+}
+
+void loop() {
+	wifiConnection.checkWiFi();
+
+	if (displayOn) {
+		display();
+	}
+
 
 	/*
 	  http.begin("http:///");

		else
		{
			localIP = WiFi.localIP().toString();
			long rssi = WiFi.RSSI();
			Serial.print("RSSI:");
			Serial.println(rssi);
		}
	}


	wifiConnection.checkWiFi();
}

extern "C" void esp_schedule();

extern void delay_end(void* arg);

void button_pressed() {
	DEBUG_PRINTLN("Button pressed!");
	lastButtonPressed = 0;
	displayOn = true;
	pause_in_ms = PAUSE_ACTIVE_IN_MS;
	u8g2.display();
	esp_schedule();
}

void display() {
	String displayData;
	sensors_event_t event;
	dht.temperature().getEvent(&event);
