diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..080e70d --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] +} diff --git a/src/main.cpp b/src/main.cpp index ad50d5a..170fc1a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,9 +6,11 @@ #ifndef APSSID #define APSSID "ESPap" -#define APPSK "thereisnospoon" +#define APPSK "thereisnospoon" #endif +#define BUTTON D2 + /* Set these to your desired credentials. */ const char *APssid = APSSID; const char *APpassword = APPSK; @@ -21,14 +23,15 @@ WiFiClient wifiClient; String HOST_ADDRESS = "192.168.0.47"; -String make_toggle_request(){ +String make_toggle_request() +{ HTTPClient http; String ADCData, station, getData, request; request = "http://" + HOST_ADDRESS + "/cm?cmnd=Power24%20Toggle"; Serial.println("Sent request to:" + request); - http.begin(wifiClient, request); - + http.begin(wifiClient, request); + auto httpCode = http.GET(); String response = http.getString(); http.end(); @@ -36,18 +39,22 @@ String make_toggle_request(){ return response; } -void handleRoot() { - make_toggle_request(); - web_server.send(200, "text/html", "