 	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);

String postData = String("temperature=");

HTTPClient http;

static const unsigned int NUM_WIFI_FRAMES = 5;
static const uint8_t WIFI_FRAMES[NUM_WIFI_FRAMES][32] = {

		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:///");
