Skip to content

Commit

Permalink
Fix gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
gsexton committed Oct 21, 2024
1 parent 8282482 commit 2ad6eb9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ds18b20/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
//
// This program enumerates onewire buses for DS18B20 sensors and
// This program enumerates onewire buses for DS18B20 sensors and
// continuously reading them.
//
// If you get the error no buses were found, ensure that onewire buses
// are enabled. On a Raspberry Pi, run raspi-config, Interface Options,
// and enable 1-Wire. Remember to reboot after enabling it.
// and enable 1-Wire. Remember to reboot after enabling it.
package main

import (
Expand All @@ -21,7 +21,7 @@ import (
"periph.io/x/host/v3"
)

// For the Dallas onewire devices, the conversion time is dependent on the
// For the Dallas onewire devices, the conversion time is dependent on the
// resolution. Refer to the Datasheet for more information.
const DefaultBits = 10

Expand Down Expand Up @@ -69,7 +69,7 @@ func main() {
if len(newSensors) > 0 {
// Do an initial convert on all devices on the bus.
err = ds18b20.ConvertAll(bus, DefaultBits)
if err!=nil {
if err != nil {
log.Println(err)
}
buses = append(buses, bus)
Expand All @@ -94,16 +94,16 @@ func main() {
out += fmt.Sprintf("%.2f ", t.Celsius())
} else {
log.Print(err)
out+="err "
out += "err "
}

}
fmt.Println(out)

for _, bus := range buses {
// Start the conversion cycle running while we're sleeping ...
err := ds18b20.StartAll(bus)
if err!=nil {
if err != nil {
log.Println(err)
}
}
Expand Down

0 comments on commit 2ad6eb9

Please sign in to comment.