diff --git a/ds18b20/ds18b20.go b/ds18b20/ds18b20.go index 25b1052..da3a7d0 100644 --- a/ds18b20/ds18b20.go +++ b/ds18b20/ds18b20.go @@ -8,9 +8,9 @@ import ( "errors" "time" - "periph.io/x/conn/v3" - "periph.io/x/conn/v3/onewire" - "periph.io/x/conn/v3/physic" + "periph.io/x/periph/conn" + "periph.io/x/periph/conn/onewire" + "periph.io/x/periph/conn/physic" ) // ConvertAll performs a conversion on all DS18B20 devices on the bus. @@ -33,6 +33,17 @@ func ConvertAll(o onewire.Bus, maxResolutionBits int) error { return nil } +// StartAll starts a conversion on all DS18B20 devices on the bus. +// Simmilar to ConvertAll but returns without waiting for converion to finish. +// To be used in conjunction with LastTemp() function. Convertion timing must be +// handled by other means. +func StartAll(o onewire.Bus) error { + if err := o.Tx([]byte{0xcc, 0x44}, nil, onewire.StrongPullup); err != nil { + return err + } + return nil +} + // New returns an object that communicates over 1-wire to the DS18B20 sensor // with the specified 64-bit address. //