diff --git a/sumorobot.js b/sumorobot.js index 303c3df..152e17d 100755 --- a/sumorobot.js +++ b/sumorobot.js @@ -55,9 +55,9 @@ 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.6) * 100) / (4.2 - 3.6))); - //$("#battery").html(battery + ""); - $("#bar").html("Connected"); + battery = Math.round((((battery - 3.0) * 100) / (4.2 - 3.6))); + $("#battery").html(battery + ""); + //$("#bar").html("Connected"); $("#bar").addClass("connected"); }; /* when there is an WebSocket error */