ESP01 Webserver STM32 Steuerung
Dependencies: LCD_i2c_GSOE ESP8266WebserverGSOE
Diff: main.cpp
- Revision:
- 7:40e19bb6820a
- Parent:
- 6:5353c5484d58
- Child:
- 10:54b312c82e18
diff -r 5353c5484d58 -r 40e19bb6820a main.cpp --- a/main.cpp Mon Jul 26 06:41:11 2021 +0000 +++ b/main.cpp Mon Jul 26 08:48:24 2021 +0000 @@ -20,18 +20,21 @@ lcd myLCD; ESP8266Webserver myWebserver; - +AnalogIn poti(PA_0); string getRootPage() { string webpage; - webpage="<!DOCTYPE html>\n"; + webpage="<!DOCTYPE html>"; //HTML - webpage+="<html>\n"; - webpage+="<head>\n"; - webpage+="<title>STM32 HTTP</title>\n"; - webpage+="</head>\n"; - webpage+="<body>\n"; + webpage+="<html>"; + webpage+="<head>"; + webpage+="<title>STM32 HTTP</title>"; + webpage+="</head>"; + webpage+="<body>"; webpage+="<h1>WIFI mit STM32 ESP01</h1>\n"; + webpage+="<p>Poti:"+to_string(poti)+"</p>\n"; + webpage+="</body>"; + webpage+="</html>"; return webpage; } @@ -42,19 +45,13 @@ } -int main() -{ +int main() { myWebserver.on("/",&testfunc); - - myWebserver.begin(); - + myWebserver.begin(); myLCD.clear(); myLCD.cursorpos(0); myLCD.printf("%s",myWebserver.gibIP()); - - while(1) - { + while(1) { myWebserver.handleClient(); } - }