#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <WiFiManager.h> //导入WIFI管理模块
void setup() {
Serial.begin(115200); //配置示波器默认频率
WiFiManager manager; //实例化WIFI管理对象
manager.autoConnect("esp8266","12345678"); //配置AP模式WIFI名称和密码,用于手机连接并配置WIFI和密码
while (WiFi.status() != WL_CONNECTED) {
delay(500); //判断如果WIFI状态不是连接,延迟500毫秒输出
Serial.print("waitinng for connect wifi ...");
Serial.println(WiFi.localIP());
}
}
// void setup() { //终端模式配置WIFI
// // write your initialization code here
// Serial.begin(115200);
// WiFi.mode(WIFI_STA); //设置WIFI终端模式
// WiFi.begin("ChinaNet-Ks22","12345678");
// while (WiFi.status() != WL_CONNECTED) {
// delay(500);
// Serial.print("retry connect wifi...");
// Serial.print(WiFi.localIP());
// }
// }
void loop() {
}
标签:WiFi,ESP8266,WIFI,AP,print,Serial,include,500 From: https://www.cnblogs.com/lixingli/p/18360451