From 01ec72691266925c358fb1d72ffdfbb15fcb9c52 Mon Sep 17 00:00:00 2001 From: Maximilian Stiefel Date: Sat, 6 Nov 2021 12:52:12 +0000 Subject: [PATCH] Latest changes --- app/application.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/app/application.cpp b/app/application.cpp index 4f681a2..6a61286 100644 --- a/app/application.cpp +++ b/app/application.cpp @@ -18,10 +18,6 @@ std::vector colorVec{LED_R, LED_G, LED_B}; HttpServer server; FtpServer ftp; -int inputs[] = {0, 2}; // Set input GPIO pins here -Vector namesInput; -const int countInputs = sizeof(inputs) / sizeof(inputs[0]); - uint8_t pins[3] = {LED_R, LED_G, LED_B}; // List of pins that you want to connect to pwm HardwarePWM HW_pwm(pins, 3); @@ -65,9 +61,9 @@ void onAjaxInput(HttpRequest& request, HttpResponse& response) } JsonObject gpio = json.createNestedObject("gpio"); - for(int i = 0; i < countInputs; i++) - gpio[namesInput[i].c_str()] = digitalRead(inputs[i]); - + /*for(int i = 0; i < countInputs; i++) + gpio[namesInput[i].c_str()] = digitalRead(inputs[i]); + */ response.sendDataStream(stream, MIME_JSON); } @@ -121,9 +117,9 @@ void gotIP(IpAddress ip, IpAddress netmask, IpAddress gateway) startWebServer(); Serial.println("Grueziii <<<<<<<<<<<<<<<<<<<<<"); for (const uint8_t& c : colorVec) { - setColor(c, 100); + setColor(c, 0); } - //setColor(LED_G, 50); + setColor(LED_G, 0); } void init() @@ -137,10 +133,10 @@ void init() WifiStation.config(WIFI_SSID, WIFI_PWD); WifiAccessPoint.enable(false); - for(int i = 0; i < countInputs; i++) { + /*for(int i = 0; i < countInputs; i++) { namesInput.add(String(inputs[i])); pinMode(inputs[i], INPUT); - } + }*/ // Run our method when station was connected to AP WifiEvents.onStationGotIP(gotIP);