Delay before ESP HelloServer
Posted: Mon Nov 20, 2017 3:44 pm
Hey!
I try to add a five-second delay before the HelloServer script connects to my Wifi, but whatever I do it does not work, either there's a problem to compile or the ESP does not connect at all. Can anyone kick me in the right direction?
I try to add a five-second delay before the HelloServer script connects to my Wifi, but whatever I do it does not work, either there's a problem to compile or the ESP does not connect at all. Can anyone kick me in the right direction?
Code: Select all
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
const char* ssid = "WiFi";
const char* password = "Password";
delay(5000): // here somewhere
ESP8266WebServer server(80);
void handleRoot() {
digitalWrite(led, 1);
server.send(200, "text/plain", "hello from esp8266!");
digitalWrite(led, 0);
}