Can anyone describe me about
ds.convert_temp() module ?
Code: Select all
# https://github.com/micropython/micropython/blob/master/drivers/onewire/ds18x20.py
_CONVERT = const(0x44)
def convert_temp(self):
self.ow.reset(True)
self.ow.writebyte(self.ow.SKIP_ROM)
self.ow.writebyte(_CONVERT)
Code: Select all
import time, ds18x20
ds = ds18x20.DS18X20(ow)
roms = ds.scan()
ds.convert_temp()
time.sleep_ms(750)
for rom in roms:
print(ds.read_temp(rom))
# http://docs.micropython.org/en/latest/esp8266/quickref.html
Armen