Golang sensor library for raspberry pi
This package reads thermometer data for the DS18B20.
tempReader, err := thermo.NewTemperatureReader("28-0000075fd199")
if err != nil {
fmt.Println(err)
panic("Error initializing temperature reader")
}
for {
temp, err := tempReader.ReadTemp()
if err != nil {
fmt.Println(err)
panic("Error reading temp")
}
fmt.Println(temp.Pretty())
time.Sleep(1 * time.Minute)
}