From 852092e998af8080758b9c7166009d6dd306746a Mon Sep 17 00:00:00 2001 From: agreiner Date: Mon, 12 Apr 2021 23:10:12 +0200 Subject: [PATCH] Added base functionality --- WEBSERVER_LED_CONTROL.ino | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 WEBSERVER_LED_CONTROL.ino 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"); +}