finding a bug

This commit is contained in:
Daniel Ledda
2020-10-31 16:17:33 +01:00
parent 07b870ef00
commit ed52d43e48

View File

@@ -113,8 +113,8 @@ func storeCycleCountsAsBinarySequence(cycles *[80]int) ([5]byte, error) {
}
func convertToRhAndTemp(data [5]byte) (float32, float32) {
rh := float32(data[0]) + float32(int(data[1]) << 4)
temp := float32(data[2]) + float32(int(data[3]) << 4)
rh := float32(int(data[0]) << 8) + float32(data[1])
temp := float32(int(data[0]) << 8) + float32(data[3])
return rh/10, temp/10
}