diff --git a/WEBSERVER_LED_CONTROL.ino b/WEBSERVER_LED_CONTROL.ino new file mode 100644 index 0000000..77b37a1 --- /dev/null +++ b/WEBSERVER_LED_CONTROL.ino @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include + +ESP8266WebServer server(80); + +void setup() { + + // Initialize Wifi, start AP if no saved Wifi in range + WiFiManager wifiManager; + wifiManager.autoConnect("WEMOS D1 mini pro"); + + server.on("/", handleRoot); + server.onNotFound(handleNotFound); + + server.begin(); +} + +void loop() { + server.handleClient(); +} + +void handleRoot() { + server.send(200, "text/plain", "hello from esp8266!"); +} + +void handleNotFound() { + server.send(404, "text/plain", "404 File Not Found"); +}