   }
   lastButtonState = buttonState;
 }
+
+void loop()
+{
+  ir_loop();
+  WiFi.run();
+}


int lastButtonState;

void loop()
{
  // If button pressed, send the code.
  int buttonState = digitalRead(BUTTON_PIN);
  if (lastButtonState == HIGH && buttonState == LOW) {

    pinMode(BUTTON_PIN, INPUT);
    pinMode(STATUS_PIN, OUTPUT);
    Serial.begin(9600);
    
    WiFi.init();
    Serial.println("Started webserver ...");
}

