10-14-2017 08:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

SunsetRunner
10-14-2017 08:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
If the OnKeyPress event (function) is before the hrm event, the hrm output fails.
If I turn the order around, the hrm event will work but the OnKeypress event fails.
Only by switching the order in the code (It doesn't matter what happens within the functions).
document.onkeypress = function(e) { switch(e.key) { case "up": (config) ? setServe(sides.SIDE_A) : setScore(sides.SIDE_A); break; case "down": (config) ? setServe(sides.SIDE_B) : setScore(sides.SIDE_B); break; case "back": hrm.stop(); break; } (debugLevel >= levels.LOW) && console.log(e.Key); } var hrm = new HeartRateSensor(); var txtHeartRate = document.getElementById("heartrate"); hrm.onreading = function() { txtHeartRate.innerText = hrm.heartRate; (debugLevel >= levels.HIGH) && console.log(hrm.heartRate); hrm.stop(); }

10-14-2017 09:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-14-2017 09:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Put these two lines above both events.
var hrm = new HeartRateSensor(); var txtHeartRate = document.getElementById("heartrate");

10-14-2017 10:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

SunsetRunner
10-14-2017 10:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Same Problem 😞

10-18-2017 13:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

SunsetRunner
10-18-2017 13:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Doesn't anyone have an idea?

10-18-2017 16:10
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-18-2017 16:10
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Can you put the project on Github? Thanks

