惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
G
Google Developers Blog
B
Blog
Engineering at Meta
Engineering at Meta
阮一峰的网络日志
阮一峰的网络日志
The Register - Security
The Register - Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 叶小钗
The Cloudflare Blog
The Hacker News
The Hacker News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
雷峰网
雷峰网
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
A
About on SuperTechFans
量子位
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
H
Help Net Security
Help Net Security
Help Net Security
P
Palo Alto Networks Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Troy Hunt's Blog
W
WeLiveSecurity
V
Vulnerabilities – Threatpost
T
The Exploit Database - CXSecurity.com
Know Your Adversary
Know Your Adversary
Apple Machine Learning Research
Apple Machine Learning Research
Scott Helme
Scott Helme
N
News | PayPal Newsroom
AWS News Blog
AWS News Blog
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
腾讯CDC
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
TaoSecurity Blog
TaoSecurity Blog
GbyAI
GbyAI
Y
Y Combinator Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
D
Docker

Lan小站-嗯,不错! - 物联网

ESP8266开发板接入点模式 - Lan小站-嗯,不错! MicroPython控制ESP8266灯光开关 - Lan小站-嗯,不错!
ESP8266开发板无线终端模式 - Lan小站-嗯,不错!
Lan · 2021-02-25 · via Lan小站-嗯,不错! - 物联网
#include <ESP8266WiFi.h>  // 程序使用ESP8266WiFi库
const char *ssid = "WIFI名";  //WIFI名
const char *pwd = "密码"; //WIFI密码

void setup() {
  Serial.begin(9600);  //启动串口通讯
  WiFi.begin(ssid,pwd); //连接
  while (WiFi.status() != WL_CONNECTED){
    delay(1000); //每隔一秒重连一次
    Serial.print('.');
  }
  Serial.print("IP:");
  Serial.print(WiFi.localIP()); //输出IP
}

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

}

连接WIFI并输出IP地址

升级版,多个WIFI备选

#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>

ESP8266WiFiMulti wifiMulti; //实例化对象

void setup()
{
  Serial.begin(9600);
  wifiMulti.addAP("WI-FI","12345678");
  wifiMulti.addAP("WI-FI_5G","12345678");
  
  while (wifiMulti.run() != WL_CONNECTED)
  {
    delay(1000);
    Serial.print('.');
  }
  Serial.print("Connected to ");
  Serial.println(WiFi.SSID());
  Serial.print("IP:");
  Serial.print(WiFi.localIP());
}

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

学习教程-太极创客:http://www.taichi-maker.com/homepage/esp8266-nodemcu-iot/iot-c/