Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elktros/6d55a7f3ea938558730fa280527ae03a to your computer and use it in GitHub Desktop.
Save elktros/6d55a7f3ea938558730fa280527ae03a to your computer and use it in GitHub Desktop.
HTML Code for creating a simple Web Page for Web Controlled Servo using ESP8266.
<!DOCTYPE html >
<html>
<head>
<title>Web controlled Servo</title>
<script src="myjquery.js"></script>
</head>
<body>
<h2> <b> Web Controlled Servo using ESP8266 </b> </h2>
<h3> Slide to move the Servo </h3>
<input type="range" min="10" max="170" onmouseup="myservo(this.value)" />
</body>
<script>
$.ajaxSetup({timeout:1000});
function myservo(angle)
{
IPVar = "192.168.1.254";
ArduinoData = "http://" + IPVar + ":80";
$.get( ArduinoData, { "servo": angle }) ;
{Connection: close};
}
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment