Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: LCD_i2c_GSOE ESP8266WebserverGSOE
main.cpp
00001 /* ATCmdParser usage example 00002 * Copyright (c) 2016 ARM Limited 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #include "mbed.h" 00018 #include "ESP8266Webserver.h" 00019 #include "LCD.h" 00020 00021 lcd myLCD; 00022 ESP8266Webserver myWebserver; 00023 AnalogIn poti(PA_0); 00024 string getRootPage() 00025 { 00026 string webpage; 00027 webpage="<!DOCTYPE html>"; 00028 //HTML 00029 webpage+="<html>"; 00030 webpage+="<head>"; 00031 webpage+="<title>STM32 HTTP</title>"; 00032 webpage+="</head>"; 00033 webpage+="<body>"; 00034 webpage+="<h1>WIFI mit STM32 ESP01</h1>\n"; 00035 webpage+="<p>Poti:"+to_string(poti)+"</p>\n"; 00036 webpage+="</body>"; 00037 webpage+="</html>"; 00038 return webpage; 00039 } 00040 00041 00042 void testfunc() 00043 { 00044 myWebserver.send(200,"text/html",getRootPage()); 00045 } 00046 00047 00048 int main() { 00049 myWebserver.on("/",&testfunc); 00050 myWebserver.begin(); 00051 myLCD.clear(); 00052 myLCD.cursorpos(0); 00053 myLCD.printf("%s",myWebserver.gibIP()); 00054 while(1) { 00055 myWebserver.handleClient(); 00056 } 00057 }
Generated on Thu Aug 11 2022 15:59:30 by
1.7.2