#include ESP8266WiFi.h
#includeesp8266web服务器. h
const char *ssid=危机引出PDCN;
const char *passwd=危机抽屉1234567890 "
ESP8266web服务器ESP8266_服务器(80;
void设置() }
//put your setup code here,to run once:
Serial.Begin(9600;
//wifi.softap(ssid,passwd );
wifi.Begin(ssid,passwd );
Serial.print (危机触发Connect to危机触发);
序列. print (ssid;
serial.println("…";
int i=0;
wile(wifi.status )!=WL_CONNECTED ) {
延迟(1000;
序列. print (I; serial.print (’);
}
延迟(1000; Serial.println (' ); serial.println('connectok . '; serial.println (IP地址: { } ); serial.println(wifi.localip ) ); esp8266_server.begin (; ESP8266_server.on('/',handleRoot ); esp 8266 _ server.on not found (handle not found; serial.println (http服务器启动…); }
Void手持根(
ESP8266_server.send(200,危机提取文本/平面),危机提取hellofromESP8266webserver(~~ )
}
void handleNotFound
ESP8266_server.send(404,危机提取文本/平面),危机提取404 theresourcewasnotfoundonesp 8266 web server (~~ ) ) )
}
语音提示(语音) {
esp 8266 _ server.handle客户端(;
//put your main code here,to run repeatedly:
}