Skip to content

Commit

Permalink
Zero HR if PM5 claims 255 (disconnected status)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrverrall committed Feb 25, 2021
1 parent caf7478 commit 7318e6e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion peripheral/hrm.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ func NewHRM(deviceName string) *Sensor {
},
trasform: func(in pm5.Status, out []byte) []byte {
//BPM
copy(out[1:], []byte{in.Heartrate}[:1])
if in.Heartrate < 255 {
out[1] = in.Heartrate
}
return out
},
}
Expand Down

0 comments on commit 7318e6e

Please sign in to comment.