@Gordon Thanks for pointing this out - moving the code outside the init() function does not require setInterval to keep the program alive, as it is done directly by HRM events. Thank you! Just wanted to as you one last thing - for now the app only runs when it is open - as soon as I get back to the main menu, the advertising stops. Is this an intended way to do it or is there a way to run it in the background? I've tried playing with
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@Gordon Thanks for pointing this out - moving the code outside the init() function does not require setInterval to keep the program alive, as it is done directly by HRM events. Thank you! Just wanted to as you one last thing - for now the app only runs when it is open - as soon as I get back to the main menu, the advertising stops. Is this an intended way to do it or is there a way to run it in the background? I've tried playing with
but it recreates the main screen in an arbitrary way. As soon as I want to interact with the menu (press the side button), the program stops.