01-10-2018 10:23
01-10-2018 10:23
When using the provided tutorial code for the HR meter it's failing to pull back heart rate values. Below is a snippet of the code. When I switch it to pull it directly with setinterval() I see the value is showing null. I've restarted my watch, turned the heart rate monitor on and off and still nothing. I'm also able to read values from the other sensors so this is just an issue with the HR monitor which is the main sensor I need. Your assistance is greatly appreciated.
/ Create a new instance of the HeartRateSensor object
var hrm = new HeartRateSensor();
// Declare a even handler that will be called every time a new HR value is received.
hrm.onreading = function() {
// Peek the current sensor values
console.log("Current heart rate: " + hrm.heartRate);
hrLabel.text = hrm.heartRate;
lastValueTimestamp = Date.now();
}
// Begin monitoring the sensor
hrm.start();
// And update the display every .5s
setInterval(updateDisplay, 500);
Answered! Go to the Best Answer.
01-10-2018 10:28
01-10-2018 10:28
Check that you've granted permission to the heart rate sensor in the package.json
01-10-2018 10:28
01-10-2018 10:28
Check that you've granted permission to the heart rate sensor in the package.json
01-10-2018 10:37
01-10-2018 10:37
TY so much that was the key.