DS18X20
--- DS18X20温度传感器关联功能函数¶
ds18x20
模块的主要功能与函数
DS18B20与开发板接线对应引脚:¶
TPYBoard DS18B20 GND GND 3V3 VCC Y10 D0
程序示例:¶
# main.py -- put your code here!
from pyb import Pin
from ds18b20 import DS18X20
wd = DS18X20(Pin('Y10')) #设置DS18B20 DO引脚为Y10
while True:
print(当前温度:',wd.read_temp())
pyb.delay(1000)