mirror of https://github.com/espruino/BangleApps
Merge pull request #313 from msdeibel/master
Fixed home button and added readme for WOHRMpull/312/head
commit
fe884a9342
|
@ -891,6 +891,7 @@
|
|||
"name": "Workout HRM",
|
||||
"icon": "app.png",
|
||||
"version":"0.06",
|
||||
"readme": "README.md",
|
||||
"description": "Workout heart rate monitor notifies you with a buzz if your heart rate goes above or below the set limits.",
|
||||
"tags": "hrm,workout",
|
||||
"type": "app",
|
||||
|
|
|
@ -4,3 +4,4 @@
|
|||
0.04: Only buzz on high confidence (>85%)
|
||||
0.05: Improved buzz timing and rendering
|
||||
0.06: Removed debug outputs, fixed rendering for upper limit, improved rendering for +/- icons, changelog version order fixed
|
||||
0.07: Home button fixed and README added
|
|
@ -0,0 +1,29 @@
|
|||
# Summary
|
||||
Workout heart rate monitor that buzzes when your heart rate hits the limits.
|
||||
|
||||
This app is for the [Bangle.js watch](https://banglejs.com/). While active it monitors your heart rate
|
||||
and will notify you with a buzz whenever your heart rate falls below or jumps above the set limits.
|
||||
|
||||
# How it works
|
||||
[Try it out](https://www.espruino.com/ide/emulator.html?codeurl=https://raw.githubusercontent.com/msdeibel/BangleApps/master/apps/wohrm/app.js&upload) using the [online Espruino emulator](https://www.espruino.com/ide/emulator.html).
|
||||
|
||||
## Setting the limits
|
||||
For setting the lower limit press button 4 (left part of the watch's touch screen).
|
||||
Then adjust the value with the buttons 1 (top) and 3 (bottom) of the watch.
|
||||
|
||||
For setting the upper limit act accordingly after pressing button 5 (the right part of the watch's screen).
|
||||
|
||||
## Reading Reliability
|
||||
As per the specs of the watch the HR monitor is not 100% reliable all the time.
|
||||
That's why the WOHRM displays a confidence value for each reading of the current heart rate.
|
||||
|
||||
To the left and right of the "Current" value two colored bars indicate the confidence in
|
||||
the received value: For 85% and above the bars are green, between 84% and 50% the bars are yellow
|
||||
and below 50% they turn red.
|
||||
|
||||
## Closing the app
|
||||
Pressing button 2 (middle) will switch off the HRM of the watch and return you to the launcher.
|
||||
|
||||
# HRM usage
|
||||
The HRM is switched on when the app is started. It stays switch on while the app is running, even
|
||||
when the watch screen goes to stand-by.
|
|
@ -287,13 +287,11 @@ function resetHighlightTimeout() {
|
|||
setterHighlightTimeout = setTimeout(setLimitSetterToNone, 2000);
|
||||
}
|
||||
|
||||
// Show launcher when middle button pressed
|
||||
function switchOffApp(){
|
||||
Bangle.setHRMPower(0);
|
||||
Bangle.showLauncher();
|
||||
}
|
||||
|
||||
// special function to handle display switch on
|
||||
Bangle.on('lcdPower', (on) => {
|
||||
g.clear();
|
||||
if (on) {
|
||||
|
@ -312,19 +310,18 @@ Bangle.setHRMPower(1);
|
|||
Bangle.on('HRM', onHrm);
|
||||
|
||||
setWatch(incrementLimit, BTN1, {edge:"rising", debounce:50, repeat:true});
|
||||
setWatch(switchOffApp, BTN2, {edge:"rising", debounce:50, repeat:true});
|
||||
setWatch(decrementLimit, BTN3, {edge:"rising", debounce:50, repeat:true});
|
||||
setWatch(setLimitSetterToLower, BTN4, {edge:"rising", debounce:50, repeat:true});
|
||||
setWatch(setLimitSetterToUpper, BTN5, { edge: "rising", debounce: 50, repeat: true });
|
||||
|
||||
setWatch(switchOffApp, BTN2, {edge:"falling", debounce:50, repeat:true});
|
||||
|
||||
g.clear();
|
||||
Bangle.loadWidgets();
|
||||
Bangle.drawWidgets();
|
||||
//drawTrainingHeartRate();
|
||||
|
||||
renderHomeIcon();
|
||||
renderLowerLimitBackground();
|
||||
renderUpperLimitBackground();
|
||||
|
||||
// refesh every sec
|
||||
setInterval(drawTrainingHeartRate, 1000);
|
||||
|
|
Loading…
Reference in New Issue