Last active
September 9, 2019 08:23
-
-
Save ruten-proteus/ebd9350cc4b6f4eca135d6c0e9607577 to your computer and use it in GitHub Desktop.
ESP8266 WPS 功能測試
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
void setup(void) | |
{ | |
Serial.begin(115200); | |
Serial.println(); | |
Serial.printf("Wi-Fi mode set to WIFI_STA %s\n", WiFi.mode(WIFI_STA) ? "" : "Failed!"); | |
Serial.print("Begin WPS (press WPS button on your router) ... "); | |
Serial.println(WiFi.beginWPSConfig() ? "Success" : "Failed"); | |
while (WiFi.status() != WL_CONNECTED) | |
{ | |
delay(500); | |
Serial.print("."); | |
} | |
Serial.println(); | |
Serial.print("Connected, IP address: "); | |
Serial.println(WiFi.localIP()); | |
} | |
void loop() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment