in order to further improve the start_conversion method, I would like to suggest this change:
ow = self.ow
ow.reset()
if rom is None:
ow.write_byte(ow.CMD_SKIPROM)
else:
ow.select_rom(rom)
ow.write_byte(0x44) # Convert Temp
This would enable us to invoke the method just once for all DS18X20 sensors attached to a single 1-Wire bus and afterwards sequentially collect the readings from the scratch memory of individual sensors.
Hi Robert,
in order to further improve the
start_conversion
method, I would like to suggest this change:This would enable us to invoke the method just once for all DS18X20 sensors attached to a single 1-Wire bus and afterwards sequentially collect the readings from the scratch memory of individual sensors.
The proposal is coming from the idea the driver within Genuine MicroPython handles it: https://github.com/micropython/micropython/blob/v1.11/drivers/onewire/ds18x20.py#L18-L21
With kind regards, Andreas.