robert-hh / Onewire_DS18X20

Classes for driving the DS18x20 sensor with the onewire protocol for Pycom MicroPython
11 stars 6 forks source link

What does mean "required" in reset()? #18

Closed MauroDiamantino closed 1 year ago

MauroDiamantino commented 1 year ago

Hi, what is the purpose of the parameter required in the method reset() of onewire.py? Does it state that checking the presence pulse after reset is important or nor?

robert-hh commented 1 year ago

Exactly what README.md tells: Resets the bus. If the parameter required is True, AssertError is raised if no device on the bus responds.

So calling reset(required=True) raises an error if no device is detected. Otherwise it silently ignores that state.