Debugging and troubleshooting
-
I am still learning my ways but wanted to see if there is anyone who has any ideas on where to start troubleshooting (and how to do it). I am new to both JS and have been away from coding for many years.
I am trying to develop an app that is pretty similar to the standard “intensity zones” screen - but with a few changes/improvements:
I will use it for heartrate based intervals so I want the app to start a counter once the 5s trailing HR >= a specific zone (and reset the time count once 5s trailing HR falls out of this specific zone
This was my original idea on how to identify 5s trailing HR (in evaluate function):
HRacc5.shift(); //remove oldest value from HRacc5 array HRacc5[4] = input.HRCurrent; //add current HR to position five in array var HRavg5 = HRacc5.reduce( function(total, num){ return total + num }) / 5;Followed by a series of if statements based on HRavg5. (The app works well in the simulator)
However - when testing the app on the watch it freezes like a couple of minutes into the workout and I need to soft reset it.
After eliminating almost everything in the code I have come to the conclusion that the above snippet is about the only thing in in the code that could possibly cause any errors.
All ideas on how to proceed with troubleshooting is most welcome!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login