 	wifiConnection.checkWiFi();
 }
 
+extern "C" void esp_schedule();
+
+extern void delay_end(void* arg);
+
 void button_pressed() {
-	Serial.println("Button pressed!");
-}
-
-void loop() {
-	wifiConnection.checkWiFi();
-
+	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);


	  http.end();
	*/
	delay(1000 * 1);
}



		else
		{
			localIP = WiFi.localIP().toString();
		}
	}

