Ai
2 Star 3 Fork 1

猴哥/esp8266-micropython

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
modular_dht11.py 471 Bytes
一键复制 编辑 原始数据 按行查看 历史
猴哥 提交于 2021-07-28 21:07 +08:00 . ...
import dht
import machine
import modular_i2c
# 接线
# VCC -> 3v
# GND -> g
# DATA -> pin4 = d2
def get_current_context():
modular_i2c.show_loading()
d = dht.DHT11(machine.Pin(14))
d.measure()
# d.temperature() # eg. 23 (°C)
# d.humidity() # eg. 41 (% RH)
temperature = d.temperature()
humidity = d.humidity()
result = {
"temperature": temperature,
"humidity": humidity
}
modular_i2c.show_oled(result)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/baozhuo/esp8266-micropython.git
git@gitee.com:baozhuo/esp8266-micropython.git
baozhuo
esp8266-micropython
esp8266-micropython
master

搜索帮助