材料:
1、ESP8266开发板×1
2、0.96寸OLED屏幕i2c接口×1
3、母对母杜邦线×4
4、USB数据线×1
5、openweathermap天气Key码一个
![](http://mhtbk.cn/wp-content/uploads/2020/05/1-1.jpg)
制作时使用到的固件及工具
(1) 安装驱动和Ardunio,将ESP8266用数据线连接至电脑,之后打开设备管理器,查看端口情况,能看到COM3,表示连接成功
![](http://mhtbk.cn/wp-content/uploads/2020/05/2-1.jpg)
(2) 接着配置及安装ESP8266固件,打开第一个
![](http://mhtbk.cn/wp-content/uploads/2020/05/3-1.jpg)
文件👉首选项,找到附加开发板管理器网址选项,填入查看链接
![](http://mhtbk.cn/wp-content/uploads/2020/05/4-1.jpg)
工具👉开发板👉开发板管理器,搜索ESP8266模块,安装最新版。
![](http://mhtbk.cn/wp-content/uploads/2020/05/5-1.jpg)
![](http://mhtbk.cn/wp-content/uploads/2020/05/6-1.jpg)
成功安装完固件之后,找到并安装这3个库:
1.ESP8266 Weather Station
2.JSON Streaming Parser by Daniel Eichhorn
3.ESP8266 OLED Driver for SSD1306 display by Daniel Eichhorn. 3.0.0 版本以上
![](http://mhtbk.cn/wp-content/uploads/2020/05/7-1.jpg)
(3) 安装完之后修改以下代码
![](http://mhtbk.cn/wp-content/uploads/2020/05/8-1.jpg)
填写你家WIFI名称及密码
![](http://mhtbk.cn/wp-content/uploads/2020/05/9-1.jpg)
设置为北京时间
打开查看链接
注册登陆后获取Key
![](http://mhtbk.cn/wp-content/uploads/2020/05/10-1.jpg)
再通过压缩包中的文件获取城市编号ID
![](http://mhtbk.cn/wp-content/uploads/2020/05/11-1.jpg)
获取到Key和城市ID之后进行修改
![](http://mhtbk.cn/wp-content/uploads/2020/05/12.jpg)
![](http://mhtbk.cn/wp-content/uploads/2020/05/13.jpg)
之后上传项目,稍等片刻
![](http://mhtbk.cn/wp-content/uploads/2020/05/14.jpg)
完了之后按下RST键
(4) 接线
将屏幕和esp8266按照这个连起来。
G👉gnd
3v👉vcc
d4👉scl
d3👉sda
完成以后再次按下板子上的RST键,就可以看到已经连接上wifi并且显示天气和时间了
![](http://mhtbk.cn/wp-content/uploads/2020/05/15.jpg)
本文来自酷基:首席养猪人
diy使我快乐
@小棉最可爱了 还有这种骚操作,不亏是棉棉