首页 > 编程知识 正文

esp8266websocket,esp8266指令集

时间:2023-05-03 17:31:57 阅读:46650 作者:400

#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:

}

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。