/*
* Arduino 环境下ESP8266程序
* 功能:连结WiFi,获取IP地址,串口输出IP信息
*/
#include<ESP8266WiFi.h>
void setup() {
Serial.begin(115200);
Serial.println();
WiFi.begin("WIFI_SID","WIFI_PASSWORD");
Serial.print("Connecting");
while(WiFi.status()!=WL_CONNECTED){
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected,IP adrress:");
Serial.println(WiFi.localIP());
}
void loop() {
}
原文:https://www.cnblogs.com/mqx365/p/9931907.html