|
代码在下面,我用WiFi.begin却无法连接WiFi,已经确认了热点名称和2.4GHz,大佬们知道是什么原因吗?WiFi.status先返回3-5s的7后面就全是1了
#include <ESP8266WiFi.h>
const char* ssid = "602206";
const char* password = "876543210";
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
delay(1000);
Serial.printf("Connection status:%d\n",WiFi.status());
Serial.printf("Connecting to %s\n",ssid);
WiFi.begin(ssid,password);
Serial.printf("Connection status:%d\n",WiFi.status());
while(WiFi.status()!=WL_CONNECTED)
{
delay(500);
Serial.printf("Connection status:%d\n",WiFi.status());
//delay(500);
//Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
// put your main code here, to run repeatedly:
}
|
|