from machine import Pin
from machine import Timer
import ds18x20
import onewire
import tm1637
import time
smg =tm1637.TM1637(clk=Pin(19),dio=Pin(18),brightness=7)
ow = onewire.OneWire(Pin(16))
# ow.scan()
# ow.reset()
# ow.readbyte()
#ow.writebyte(0x12)
#ow.write('123')
#ow.select_rom()
ds = ds18x20.DS18X20(ow)
roms = ds.scan()
ds.convert_temp()
time.sleep_ms(750)
for rom in roms:
print(ds.read_temp(rom))
print(roms)
wd = ds.read_temp(rom)
def display():
smg.temperature(int(wd))
#print("室内温度:%d\r\n"%(wd))
print(wd)
time.sleep_ms(500)
def main():
while True:
wd = ds.read_temp(rom)
display()
pass
from xianshiwendu import main
if __name__ == "__main__":
main()