Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update battery icon drawing
Move left side of battery icon 1px to the right.
Change fillRect to use (x, y, width, height) as it was using (x1, y1, x2, y2) and drawing lots of off screen pixels.
  • Loading branch information
NiVZ78 authored Jul 15, 2018
commit 509a0d39237cf20472b567318898e793c18edb71
12 changes: 6 additions & 6 deletions scripts/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ try {

if(batterylevel) {
//Process and display battery gauge
display.oled.drawLine(115, 57, 127, 57, 1); //top
display.oled.drawLine(115, 63, 127, 63, 1); //bottom
display.oled.drawLine(115, 57, 115, 63, 1); //left
display.oled.drawLine(116, 57, 127, 57, 1); //top
display.oled.drawLine(116, 63, 127, 63, 1); //bottom
display.oled.drawLine(116, 57, 116, 63, 1); //left
display.oled.drawLine(127, 57, 127, 63, 1); //right
display.oled.drawLine(114, 59, 114, 61, 1); //iconify
var batt = Math.round(127 - (batterylevel.battery / 10));
display.oled.fillRect(batt, 58, 126, 62, 1); //fill battery gauge
display.oled.drawLine(115, 59, 115, 61, 1); //iconify
var batt = Math.round(batterylevel.battery / 10);
display.oled.fillRect(127-batt, 58, batt, 5, 1); //fill battery gauge
}

//Create and render clock
Expand Down