https://gist.github.com/clive520/ebce394cfb41d615dffdec7a749d93f8
#include <WiFi.h>
#include <WiFiMulti.h>
#define LED_BUILTIN 2 // 連接到WIFI時,亮內建的LED
WiFiMulti wifiMulti;
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN,LOW) ;
Serial.begin(9600);
delay(10);
wifiMulti.addAP("clive_lef", "12345678");
wifiMulti.addAP("clive_1F", "12345678");
wifiMulti.addAP("book", "12345678");
Serial.println("Connecting Wifi...");
if(wifiMulti.run() == WL_CONNECTED) { //連接多個WIFI
delay(50);
Serial.println("");
Serial.print("Successful Connecting to Access Point:");
Serial.println(WiFi.SSID());
Serial.print("SSID Signal strength:");
Serial.println(WiFi.RSSI());//WiFi.RSSI()訊號強度
Serial.println("WiFi connected");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());//WiFi.localIP()連接到的IP
digitalWrite(LED_BUILTIN,HIGH) ; //成功時亮內建的LED
}
}
void loop()
{
}
沒有留言:
張貼留言