Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve "start_conversion" method #3

Closed
amotl opened this issue Nov 16, 2019 · 1 comment
Closed

Improve "start_conversion" method #3

amotl opened this issue Nov 16, 2019 · 1 comment

Comments

@amotl
Copy link
Contributor

amotl commented Nov 16, 2019

Hi Robert,

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.

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.

amotl added a commit to hiveeyes/MicroPythonPP_Onewire_DS18X20 that referenced this issue Nov 16, 2019
amotl added a commit to hiveeyes/MicroPythonPP_Onewire_DS18X20 that referenced this issue Nov 17, 2019
@amotl
Copy link
Contributor Author

amotl commented Nov 17, 2019

Closing this in favor of #10.

@amotl amotl closed this as completed Nov 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant