Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ESP8266WiFi.h>
- #include <ESP8266WiFiMulti.h>
- ESP8266WiFiMulti wifiMulti;
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(115200);
- WiFi.mode(WIFI_STA);
- wifiMulti.addAP("xxx", "xxx");
- wifiMulti.addAP("xxx", "xxx");
- // wifiMulti.addAP("xxx", "xxx");
- Serial.println("Connecting Wifi...");
- if (wifiMulti.run() == WL_CONNECTED) {
- Serial.println("");
- Serial.println("WiFi connected");
- Serial.println("IP address: ");
- Serial.println(WiFi.localIP());
- }
- }
- void loop() {
- // put your main code here, to run repeatedly:
- if (wifiMulti.run() != WL_CONNECTED) {
- Serial.println("WiFi not connected!");
- delay(1000);
- }
- }
Add Comment
Please, Sign In to add comment