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

推荐订阅源

V2EX - 技术
V2EX - 技术
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Latest news
Latest news
T
The Exploit Database - CXSecurity.com
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
L
Lohrmann on Cybersecurity
aimingoo的专栏
aimingoo的专栏
B
Blog
T
Threat Research - Cisco Blogs
罗磊的独立博客
Application and Cybersecurity Blog
Application and Cybersecurity Blog
P
Proofpoint News Feed
P
Palo Alto Networks Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
T
Tor Project blog
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
Recorded Future
Recorded Future
D
DataBreaches.Net
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
B
Blog RSS Feed
Scott Helme
Scott Helme
P
Proofpoint News Feed
V
Vulnerabilities – Threatpost
A
Arctic Wolf
Help Net Security
Help Net Security
L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
AWS News Blog
AWS News Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Schneier on Security
Hacker News: Ask HN
Hacker News: Ask HN
N
Netflix TechBlog - Medium
L
LangChain Blog
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
M
MIT News - Artificial intelligence
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
W
WeLiveSecurity

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/