示例#1
0
from sensor.DS18B20 import DS18B20

ds = DS18B20('28-00000736781c')

print(ds.temperature().C)
示例#2
0
def get_DS18B20_temp():
    ds = DS18B20('28-041592661eff')
    t = ds.temperature()  # read temperature
    return str(t.C)