diff --git a/apps/widbars/README.md b/apps/widbars/README.md index eba5cc347..c1cb73a96 100644 --- a/apps/widbars/README.md +++ b/apps/widbars/README.md @@ -5,10 +5,11 @@ A simple widget that display several measurements as vertical bars. ![Screenshot](screenshot.png) ## Measurements from left to right: - + - Flash storage space used (*blue/cyan*) - Memory usage (*magenta*) - Battery charge (*green*) \ No newline at end of file diff --git a/apps/widbars/icon.png b/apps/widbars/icon.png index 59f78d666..3d6fcb053 100644 Binary files a/apps/widbars/icon.png and b/apps/widbars/icon.png differ diff --git a/apps/widbars/screenshot.png b/apps/widbars/screenshot.png index 146e085e3..ae85e42f5 100644 Binary files a/apps/widbars/screenshot.png and b/apps/widbars/screenshot.png differ diff --git a/apps/widbars/widget.js b/apps/widbars/widget.js index 18d1712c6..a1134f31f 100644 --- a/apps/widbars/widget.js +++ b/apps/widbars/widget.js @@ -3,22 +3,27 @@ w=3, // width of single bar bars=3; // number of bars - // We show HRM if available, but don't turn it on - let bpm,rst,con=10; // always ignore HRM with confidence below 10% - function noHrm() { // last value is no longer valid - if (rst) clearTimeout(rst); - rst=bpm=undefined; con=10; - WIDGETS["bars"].draw(); - } - Bangle.on('HRM', hrm=>{ - if (hrm.confidence>con || hrm.confidence>=80) { - bpm=hrm.confidence; - con=hrm.confidence; - WIDGETS["bars"].draw(); - if (rst) clearTimeout(rst); - rst = setTimeout(noHrm, 10*60*1000); // forget HRM after 10 minutes - } - }); + // Note: HRM/temperature are commented out (they didn't seem very useful) + // If re-adding them, also adjust `bars` + + // ==HRM start== + // // We show HRM if available, but don't turn it on + // let bpm,rst,con=10; // always ignore HRM with confidence below 10% + // function noHrm() { // last value is no longer valid + // if (rst) clearTimeout(rst); + // rst=bpm=undefined; con=10; + // WIDGETS["bars"].draw(); + // } + // Bangle.on('HRM', hrm=>{ + // if (hrm.confidence>con || hrm.confidence>=80) { + // bpm=hrm.confidence; + // con=hrm.confidence; + // WIDGETS["bars"].draw(); + // if (rst) clearTimeout(rst); + // rst = setTimeout(noHrm, 10*60*1000); // forget HRM after 10 minutes + // } + // }); + // ==HRM end== /** * Draw a bar @@ -42,8 +47,8 @@ const x = this.x, y = this.y, m = process.memory(); let b=0; - bar(x+(w*b++),y,'#f00'/*red */,bpm/200); // >200 seems very unhealthy; if we have no valid bpm this will just be empty space - bar(x+(w*b++),y,'#ff0'/*yellow */,E.getTemperature()/50); // you really don't want to wear a watch that's hotter than 50°C + // ==HRM== bar(x+(w*b++),y,'#f00'/*red */,bpm/200); // >200 seems very unhealthy; if we have no valid bpm this will just be empty space + // ==Temperature== bar(x+(w*b++),y,'#ff0'/*yellow */,E.getTemperature()/50); // you really don't want to wear a watch that's hotter than 50°C bar(x+(w*b++),y,g.theme.dark?'#0ff':'#00f'/*cyan/blue*/,1-(require('Storage').getFree() / process.env.STORAGE)); bar(x+(w*b++),y,'#f0f'/*magenta*/,m.usage/m.total); bar(x+(w*b++),y,'#0f0'/*green */,E.getBattery()/100);