Brightness of R:
"); - client.println(""); - //G slide bar - client.println("Brightness of G:
"); - client.println(""); - //B slide bar - client.println("Brightness of B:
"); - client.println(""); - - client.println(""); - - client.println(""); - - // Processing part of HTTP request - //GET /?value=180& HTTP/1.1 - // Convert the value of R to the output of led - if (header.indexOf("GET /?valueR=") >= 0) - { - pos1 = header.indexOf('='); - pos2 = header.indexOf('&'); - valueString = header.substring(pos1 + 1, pos2); - - // LED lit with valueString value - ledcWrite(0, valueString.toInt()); - Serial.println(valueString); - } - // Convert the value of G to the output of led - if (header.indexOf("GET /?valueG=") >= 0) - { - pos1 = header.indexOf('='); - pos2 = header.indexOf('&'); - valueString = header.substring(pos1 + 1, pos2); - - // LED lit with valueString value - ledcWrite(1, valueString.toInt()); - Serial.println(valueString); - } - - // Convert the value of B to led output - if (header.indexOf("GET /?valueB=") >= 0) - { - pos1 = header.indexOf('='); - pos2 = header.indexOf('&'); - valueString = header.substring(pos1 + 1, pos2); - - // LED lit with valueString value - ledcWrite(2, valueString.toInt()); - Serial.println(valueString); - } - // End of HTTP response client.println(); - // Break out of the while loop - break; - } - else - { - currentLine = ""; - } - } - else if (c != '\r') - { - currentLine += c; - } - } - } - // Clear the header variable - header = ""; - // Disconnect connection client.stop(); - Serial.println("Client disconnected."); - Serial.println(""); - } -} \ No newline at end of file diff --git a/temp/webserver.cpp b/temp/webserver.cpp deleted file mode 100644 index 0820146..0000000 --- a/temp/webserver.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#includeGPIO 26 - State " + output26State + "
"); - // If the output26State is off, it displays the ON button - if (output26State=="off") { - client.println(""); - } else { - client.println(""); - } - - // Display current state, and ON/OFF buttons for GPIO 27 - client.println("GPIO 27 - State " + output27State + "
"); - // If the output27State is off, it displays the ON button - if (output27State=="off") { - client.println(""); - } else { - client.println(""); - } - client.println(""); - - // The HTTP response ends with another blank line - client.println(); - // Break out of the while loop - break; - } else { // if you got a newline, then clear currentLine - currentLine = ""; - } - } else if (c != '\r') { // if you got anything else but a carriage return character, - currentLine += c; // add it to the end of the currentLine - } - } - } - // Clear the header variable - header = ""; - // Close the connection - client.stop(); - Serial.println("Client disconnected."); - Serial.println(""); - } -}