Betriebsanleitung AZ-ONEBoard
//Pulling NTP Information
void
handle_OnConnect() {
timeClient.update();
unsigned long
String
formattedTime
struct
tm *ptm
formattedTime
Temperature
Humidity
server.send(200, "text/html",
SendHTML(Temperature,Humidity,formattedTime));
}
//Error-Handling
void
handle_NotFound(){
server.send(404, "text/plain",
}
//Web-Pages HTML Code
String SendHTML(float TemperatureWeb,float
TimeWeb){
String
ptr
ptr
+="<head><meta name=\"viewport\" content=\"width=device-width,
initial-scale=1.0,
ptr
+="<title> AZ-ONEBoard
ptr +="</head>\n";
ptr +="<body>\n";
ptr
+="<div
ptr
+="<h1> AZ-ONEBoard
ptr
+="<p>Time:
ptr +=(String)TimeWeb;
ptr +="</p>";
ptr
+="<p>Temperature:
ptr +=(int)TemperatureWeb;
ptr +="℃</p>";
ptr
+="<p>Humidity:
ptr +=(int)HumidityWeb;
ptr +="%</p>";
ptr +="</div>\n";
ptr +="</body>\n";
ptr +="</html>\n";
return
ptr;
}
epochTime
=
timeClient.getEpochTime();
=
timeClient.getFormattedTime();
=
gmtime
((time_t *)&epochTime);
=
timeClient.getFormattedTime();
=
sht30.cTemp;
=
sht30.humidity;
=
"<!DOCTYPE html>
user-scalable=no\">\n";
</title>\n";
id=\"webpage\">\n";
</h1>\n";
";
";
";
"Not
found");
HumidityWeb,
<html>\n";
String
42