From ff2e9fc1b775535e3737130b56596dcca4d360cf Mon Sep 17 00:00:00 2001 From: Joerg Lehmann Date: Fri, 30 Oct 2020 16:05:52 +0100 Subject: [PATCH] new voltage values for empty and full in case of supercap --- lorahandler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lorahandler.go b/lorahandler.go index ac7e531..3285f6f 100644 --- a/lorahandler.go +++ b/lorahandler.go @@ -480,8 +480,8 @@ func WriteDatapoint(mytime int64, deveui string, devaddr string, v uint8, h uint if h > 0 { sv := "" if supercap { - // vp for supercapacitor (180 is 0%, 225 is 100%) - vp = int16((float32(v) - 180) / 45.0 * 100.0) + // vp for supercapacitor (165 is 0%, 210 is 100%) + vp = int16((float32(v) - 165) / 45.0 * 100.0) if vp < 0 { vp = 0 } else if vp > 100 {