c_cpp Arduino ESP8266 WPS wifi连接

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp Arduino ESP8266 WPS wifi连接相关的知识,希望对你有一定的参考价值。

#include <ESP8266WiFi.h>


void setup() {
  Serial.begin(115200);

  // Long delay required especially soon after power on.
  delay(4000);
  // Check if WiFi is already connected and if not, begin the WPS process.
  if (WiFi.status() != WL_CONNECTED) {
      Serial.println("\nAttempting connection ...");
      WiFi.beginWPSConfig();
      // Another long delay required.
      delay(3000);
      if (WiFi.status() == WL_CONNECTED) {
        Serial.println("Connected!");
        Serial.println(WiFi.localIP());
        Serial.println(WiFi.SSID());
        Serial.println(WiFi.macAddress());
      }
      else {
        Serial.println("Connection failed!");
      }
  }
  else {
    Serial.println("\nConnection already established.");
  }
}

void loop() {
  // put your main code here, to run repeatedly:

}

以上是关于c_cpp Arduino ESP8266 WPS wifi连接的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp esp8266.arduino.ticker.ino

c_cpp esp8266.arduino.test.pwm.ino

c_cpp esp8266.arduino.connectwifi.timeout.c

c_cpp 读/写ESP8266 EEPROM - 来自https://forum.arduino.cc/index.php?topic=461677.0

arduino nano 链接 esp 8266 wifi模块

ESP8266 WIFI模块可以直接链接arduino吗