From bef66dfbdab9077ebd78302458180eb0dbec5b4d Mon Sep 17 00:00:00 2001 From: Silver Kuusik Date: Tue, 14 Nov 2017 14:59:19 +0100 Subject: [PATCH] Update sumorobot.js --- sumorobot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sumorobot.js b/sumorobot.js index bc4642a..15932b5 100755 --- a/sumorobot.js +++ b/sumorobot.js @@ -55,7 +55,7 @@ Sumorobot.prototype.connect = function() { var data = evt.data.replace(/'/g, '"').toLowerCase(); console.log(data); var battery = JSON.parse(data)["battery_voltage"]; - battery = Math.round((((battery - 3.0) * 100) / (4.2 - 3.6))); + battery = Math.round((((battery - 3.0) * 100) / (4.2 - 3.0))); $("#battery").html(battery + "%"); $("#bar").html("Battery"); $("#bar").addClass("connected");