/piBot

Golang sensor library for raspberry pi

Primary LanguageGoMIT LicenseMIT

piBot

Golang sensor library for raspberry pi

thermo

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)
}