new voltage values for empty and full in case of supercap
This commit is contained in:
parent
cce2125a0f
commit
ff2e9fc1b7
|
|
@ -480,8 +480,8 @@ func WriteDatapoint(mytime int64, deveui string, devaddr string, v uint8, h uint
|
||||||
if h > 0 {
|
if h > 0 {
|
||||||
sv := ""
|
sv := ""
|
||||||
if supercap {
|
if supercap {
|
||||||
// vp for supercapacitor (180 is 0%, 225 is 100%)
|
// vp for supercapacitor (165 is 0%, 210 is 100%)
|
||||||
vp = int16((float32(v) - 180) / 45.0 * 100.0)
|
vp = int16((float32(v) - 165) / 45.0 * 100.0)
|
||||||
if vp < 0 {
|
if vp < 0 {
|
||||||
vp = 0
|
vp = 0
|
||||||
} else if vp > 100 {
|
} else if vp > 100 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue