hrm 0.05: Tweaks for 'HRM-raw' handling

master
Gordon Williams 2021-07-27 15:41:36 +01:00
parent 2066d124fb
commit c09ec22599
3 changed files with 9 additions and 6 deletions

View File

@ -683,7 +683,7 @@
{ "id": "hrm", { "id": "hrm",
"name": "Heart Rate Monitor", "name": "Heart Rate Monitor",
"icon": "heartrate.png", "icon": "heartrate.png",
"version":"0.04", "version":"0.05",
"description": "Measure your heart rate and see live sensor data", "description": "Measure your heart rate and see live sensor data",
"tags": "health", "tags": "health",
"storage": [ "storage": [

View File

@ -2,3 +2,4 @@
0.02: Use HRM data and calculations from Bangle.js (don't access hardware directly) 0.02: Use HRM data and calculations from Bangle.js (don't access hardware directly)
0.03: Fix timing issues, and use 1/2 scale to keep graph on screen 0.03: Fix timing issues, and use 1/2 scale to keep graph on screen
0.04: Update for new firmwares that have a 'HRM-raw' event 0.04: Update for new firmwares that have a 'HRM-raw' event
0.05: Tweaks for 'HRM-raw' handling

View File

@ -46,9 +46,12 @@ Bangle.on('HRM-raw', function(v) {
g.moveTo(-100,0); g.moveTo(-100,0);
} }
y = E.clip(170 - (v.raw*2),100,230); y = E.clip(170 - (v.raw),100,230);
g.setColor(1,1,1); g.setColor(g.theme.fg).lineTo(hrmOffset, y);
g.lineTo(hrmOffset, y); if (counter !==undefined) {
counter = undefined;
g.clear();
}
}); });
// It takes 5 secs for us to get the first HRM event // It takes 5 secs for us to get the first HRM event
@ -80,7 +83,6 @@ function readHRM() {
var a = hrmInfo.raw[hrmOffset]; var a = hrmInfo.raw[hrmOffset];
hrmOffset++; hrmOffset++;
y = E.clip(170 - (a*2),100,230); y = E.clip(170 - (a*2),100,230);
g.setColor(1,1,1); g.setColor(g.theme.fg).lineTo(hrmOffset, y);
g.lineTo(hrmOffset, y);
} }
} }