hrm 0.09: Grey out BPM until confidence is over 50%

master
Gordon Williams 2022-03-22 15:22:05 +00:00
parent 7d78aa6bd1
commit 9abc9296df
3 changed files with 4 additions and 4 deletions

View File

@ -6,3 +6,4 @@
0.06: Add widgets 0.06: Add widgets
0.07: Update scaling for new firmware 0.07: Update scaling for new firmware
0.08: Don't force backlight on/watch unlocked on Bangle 2 0.08: Don't force backlight on/watch unlocked on Bangle 2
0.09: Grey out BPM until confidence is over 50%

View File

@ -35,9 +35,9 @@ function onHRM(h) {
g.clearRect(0,24,g.getWidth(),80); g.clearRect(0,24,g.getWidth(),80);
g.setFont("6x8").drawString("Confidence "+hrmInfo.confidence+"%", px, 75); g.setFont("6x8").drawString("Confidence "+hrmInfo.confidence+"%", px, 75);
var str = hrmInfo.bpm; var str = hrmInfo.bpm;
g.setFontVector(40).drawString(str,px,45); g.setFontVector(40).setColor(hrmInfo.confidence > 50 ? g.theme.fg : "#888").drawString(str,px,45);
px += g.stringWidth(str)/2; px += g.stringWidth(str)/2;
g.setFont("6x8"); g.setFont("6x8").setColor(g.theme.fg);
g.drawString("BPM",px+15,45); g.drawString("BPM",px+15,45);
} }
Bangle.on('HRM', onHRM); Bangle.on('HRM', onHRM);
@ -101,4 +101,3 @@ function readHRM() {
lastHrmPt = [hrmOffset, y]; lastHrmPt = [hrmOffset, y];
} }
} }

View File

@ -1,7 +1,7 @@
{ {
"id": "hrm", "id": "hrm",
"name": "Heart Rate Monitor", "name": "Heart Rate Monitor",
"version": "0.08", "version": "0.09",
"description": "Measure your heart rate and see live sensor data", "description": "Measure your heart rate and see live sensor data",
"icon": "heartrate.png", "icon": "heartrate.png",
"tags": "health", "tags": "health",