fix bug with voltage percent
This commit is contained in:
parent
5c42d1e751
commit
c2c2209b0d
|
|
@ -217,9 +217,9 @@ func DecodePayload(s string, deveui string, devaddr string, lrrlat float32, lrrl
|
|||
func WriteDatapoint(mytime int64, deveui string, devaddr string, v uint8, h uint8, p uint8, w uint16, w1 int32, w2 int32, t int16, lrrlat float32, lrrlon float32, fw_version int32) {
|
||||
// wir nehmen humidity als Referenz, wenn diese > 0 ist, dann ist es
|
||||
// eine gueltige Messung
|
||||
var vp uint16 // Voltage in %
|
||||
var vp int16 // Voltage in %
|
||||
if (h > 0) {
|
||||
vp = uint16(v) - 70
|
||||
vp = int16(v) - 70
|
||||
if vp < 0 {
|
||||
vp = 0
|
||||
} else if vp > 100 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue