Set BTN1 to enable heart monitor
parent
c90fd28a56
commit
25b3dc7fa8
|
|
@ -113,14 +113,20 @@ Bangle.on('lcdPower',on=>{
|
||||||
// Show launcher when middle button pressed
|
// Show launcher when middle button pressed
|
||||||
setWatch(Bangle.showLauncher, BTN2, { repeat: false, edge: "falling" });
|
setWatch(Bangle.showLauncher, BTN2, { repeat: false, edge: "falling" });
|
||||||
|
|
||||||
//HRM Controller.
|
|
||||||
Bangle.on('touch', function(button) {
|
Bangle.on('touch', function(button) {
|
||||||
if(button == 1 || button == 2){
|
if(button == 1 || button == 2){
|
||||||
if(!HRMstate){
|
Bangle.showLauncher();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//HRM Controller.
|
||||||
|
setWatch(function(){
|
||||||
|
if(!HRMstate){
|
||||||
console.log("Toggled HRM");
|
console.log("Toggled HRM");
|
||||||
//Turn on.
|
//Turn on.
|
||||||
Bangle.buzz();
|
Bangle.buzz();
|
||||||
Bangle.setHRMPower(1);
|
Bangle.setHRMPower(1);
|
||||||
|
currentHRM = "CALC";
|
||||||
HRMstate = true;
|
HRMstate = true;
|
||||||
} else if(HRMstate){
|
} else if(HRMstate){
|
||||||
console.log("Toggled HRM");
|
console.log("Toggled HRM");
|
||||||
|
|
@ -131,8 +137,7 @@ Bangle.on('touch', function(button) {
|
||||||
currentHRM = [];
|
currentHRM = [];
|
||||||
}
|
}
|
||||||
drawBPM(HRMstate);
|
drawBPM(HRMstate);
|
||||||
}
|
}, BTN1, { repeat: true, edge: "falling" });
|
||||||
});
|
|
||||||
|
|
||||||
Bangle.on('HRM', function(hrm) {
|
Bangle.on('HRM', function(hrm) {
|
||||||
if(hrm.confidence > 90){
|
if(hrm.confidence > 90){
|
||||||
|
|
@ -143,6 +148,7 @@ Bangle.on('HRM', function(hrm) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//Bangle.on('step', function(up) {
|
//Bangle.on('step', function(up) {
|
||||||
// console.log("Step");
|
// console.log("Step");
|
||||||
//});
|
//});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue