kopia lustrzana https://github.com/alanesq/esp32cam-demo
Add files via upload
rodzic
177af00d8b
commit
a57424aa88
|
@ -13,18 +13,17 @@
|
|||
|
||||
// Wifi Settings
|
||||
|
||||
#include <wifiSettings.h> // delete this line, un-comment the below two lines and enter your wifi details
|
||||
|
||||
const char *SSID = "your_wifi_ssid";
|
||||
//const char *SSID = "your_wifi_ssid";
|
||||
|
||||
const char *PWD = "your_wifi_pwd";
|
||||
//const char *PWD = "your_wifi_pwd";
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool serialDebug = 1; // enable debugging info on serial port
|
||||
|
||||
|
||||
|
@ -220,16 +219,20 @@ void handleButton(){
|
|||
|
||||
// HTML header
|
||||
const char HTML_Header[] = R"=====(
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang='en'>
|
||||
<head>
|
||||
<title>AJAX Demo</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
)=====";
|
||||
|
||||
|
||||
// HTML Body
|
||||
const char HTML_Body[] = R"=====(
|
||||
|
||||
<body>
|
||||
<div id='demo'>
|
||||
<h1>Update web page using AJAX</h1>
|
||||
<button type='button' onclick='sendData(1)'>LED ON</button>
|
||||
|
@ -240,12 +243,15 @@ void handleButton(){
|
|||
Received text : <span id='ReceivedText'>NA</span><br>
|
||||
LED State is : <span id='LEDState'>NA</span><br>
|
||||
</div>
|
||||
|
||||
)=====";
|
||||
|
||||
|
||||
// Javascript
|
||||
// functions: sendData - triggered when a html button is pressed
|
||||
// getData - refreshes data on page - received as a comma deliminated list - triggers every 2 seconds
|
||||
const char HTML_JavaScript[] = R"=====(
|
||||
|
||||
<script>
|
||||
|
||||
function sendData(led) {
|
||||
|
@ -275,6 +281,7 @@ void handleButton(){
|
|||
}, 2000);
|
||||
|
||||
</script>
|
||||
|
||||
)=====";
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue