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