diff --git a/main.go b/main.go index 2845ccb..b254085 100644 --- a/main.go +++ b/main.go @@ -34,8 +34,10 @@ func main() { fmt.Printf("Using sensor %s\n", sensor) go func() { - time.Sleep(5 * time.Second) - ParseAndSetTemp() + for { + time.Sleep(5 * time.Second) + ParseAndSetTemp() + } }() fmt.Println("Starting http server on port 2112") diff --git a/parse.go b/parse.go index 85609e4..3cd83c8 100644 --- a/parse.go +++ b/parse.go @@ -18,7 +18,11 @@ func ParseAndSetTemp() { return } - currentTemp.Set(parse(string(f))) + ct := parse(string(f)) + + fmt.Printf("Setting current temperature to %f\n", ct) + + currentTemp.Set(ct) } func parse(w1Out string) float64 {