finding a bug
This commit is contained in:
4
main.go
4
main.go
@@ -113,8 +113,8 @@ func storeCycleCountsAsBinarySequence(cycles *[80]int) ([5]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func convertToRhAndTemp(data [5]byte) (float32, float32) {
|
func convertToRhAndTemp(data [5]byte) (float32, float32) {
|
||||||
rh := float32(data[0]) + float32(int(data[1]) << 4)
|
rh := float32(int(data[0]) << 8) + float32(data[1])
|
||||||
temp := float32(data[2]) + float32(int(data[3]) << 4)
|
temp := float32(int(data[0]) << 8) + float32(data[3])
|
||||||
return rh/10, temp/10
|
return rh/10, temp/10
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user