Turn on HRM when screen is on and unlocked
parent
7b09fd9b4f
commit
5903aed3e4
|
|
@ -104,9 +104,11 @@ function drawInfo(now) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawHeartRate(i) {
|
function drawHeartRate(i) {
|
||||||
|
writeLineTopic("HRTM", i);
|
||||||
if (hrtValue != undefined) {
|
if (hrtValue != undefined) {
|
||||||
writeLineTopic("HRTM", i);
|
|
||||||
writeLine(hrtValue,i);
|
writeLine(hrtValue,i);
|
||||||
|
} else {
|
||||||
|
writeLine("-",i);
|
||||||
}
|
}
|
||||||
lastHeartRateRowIndex = i;
|
lastHeartRateRowIndex = i;
|
||||||
}
|
}
|
||||||
|
|
@ -129,6 +131,15 @@ function writeLine(str,line){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// turn on HRM when the LCD is unlocked
|
||||||
|
Bangle.on('lock', function(isLocked) {
|
||||||
|
if (!isLocked) {
|
||||||
|
Bangle.setHRMPower(1,"clicompleteclk");
|
||||||
|
hrtValue = undefined;
|
||||||
|
} else {
|
||||||
|
Bangle.setHRMPower(0,"clicompleteclk");
|
||||||
|
}
|
||||||
|
});
|
||||||
Bangle.on('HRM', function(hrm) {
|
Bangle.on('HRM', function(hrm) {
|
||||||
//if(hrm.confidence > 90){
|
//if(hrm.confidence > 90){
|
||||||
hrtValue = hrm.bpm + " bpm";
|
hrtValue = hrm.bpm + " bpm";
|
||||||
|
|
@ -173,6 +184,7 @@ Bangle.setUI("clock");
|
||||||
Bangle.loadWidgets();
|
Bangle.loadWidgets();
|
||||||
Bangle.drawWidgets();
|
Bangle.drawWidgets();
|
||||||
drawAll(true);
|
drawAll(true);
|
||||||
|
|
||||||
Bangle.on('lcdPower',function(on) {
|
Bangle.on('lcdPower',function(on) {
|
||||||
if (on) {
|
if (on) {
|
||||||
drawAll(true);
|
drawAll(true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue