首先要先能連上自己的WIFI
#include <ESP8266WiFi.h>
const char* ssid="APAP"; //要連上的Wifi名稱
const char* pass="09876543";//要連上的Wifi密碼
void setup( ){
Serial.begin(115200);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {//當連線成功時跳出迴圈
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}