Pindi King wrote:Hi Swlison,
That's an impressive work.
I am looking for an example sketch with just one slider and its receiving code for ESP8266. I being a newbie trying to finish level control.
I have modified your html code to have just one line slider control.
Please help me if you can further change it to get the response by moving the slider on PC without the submit button.Code: Select all.
.
.
.
.
if(request.indexOf("?????????") != -1) // WHAT SHOULD GO IN PLACE OF "???????" IN THIS LINE ?
.
.
.
.
// Return the response
client.println("<!DOCTYPE HTML>");
client.println("<html>");
client.println("<head>");
client.println("<title> Level Setting </title>");
client.println("<form method=get><br>Level: <input type='range' min='1' max='100' name=levelVal value='levelTemp' oninput='showValue(this.value)'>");
client.println("<span id='range'>50</span>");
client.println("<script type='text/javascript'>");
client.println("function showValue(newValue)");
client.println("{");
client.println("document.getElementById('range').innerHTML=newValue;");
client.println("}");
client.println("</script>");
client.println(" <br><br><input name=H type=submit value=submit><br><br>");
client.println("</script>");
client.println("</head>");
client.println("</html>");
delay(1);
Serial.println("Client disonnected");
Serial.println("");
}
Thanks
Try this post http://www.esp8266.com/viewtopic.php?f=8&t=4307. There is some code on page 7 or 8 with a working slider. Also you might want to check out using websockets as well.
Also check this page out: https://babaawesam.com/2015/11/26/control-input-output-of-esp8266-with-ajax/