这是我的页面的HTML代码。我在这里使用了JQuery。 ESP8266 LED控制 如何通过ESP8266模块将数据从网页发送到Arduino UNO?
Toggle Pin 11
Toggle Pin 12
Toggle Pin 13
$(document).ready(function(){
$(".led").click(function(){
var p = $(this).attr('id'); // get id value (i.e. pin13, pin12, or pin11)
// send HTTP GET request to the IP address with the parameter "pin" and value "p", then execute the function
alert("Sending Get Request");
$.get("http://192.168.4.1:80/", {pin:p}); // execute get request
});
});