       //if you get here you have connected to the WiFi
       Serial.println("connected...yeey :)");
     }
-    digitalWrite(LED_BUILTIN, HIGH); // Turn led off as we are not in configuration mode.
     ESP.reset(); // This is a bit crude. For some unknown reason webserver can only be started once per boot up so resetting the device allows to go back into config mode again when it reboots.
     delay(5000);
   }

}
//------------- end main functions----------------------------------------  
void setup() {
  pinMode(LED_PIN, OUTPUT);
  pinMode(TRIGGER_PIN, INPUT_PULLUP);
  digitalWrite(LED_PIN, HIGH); //turn off led  
  int start_time = millis(); // remember starttime
  servo.attach(MOTOR_PIN);
  servo.write(0); // initial position

  if ((digitalRead(TRIGGER_PIN) == LOW) || (initialConfig)) {
    Serial.println("Configuration portal requested.");
     server.reset(new ESP8266WebServer(WiFi.localIP(), 80));
     digitalWrite(LED_PIN_BLUE, LOW);
    WiFiManager wifiManager;

    //it starts an access point and goes into a blocking loop awaiting configuration
