@Gordon: I think there is still something going on. I had been banging my head against my table trying to get one of my pucks controlling the other via bluetooth and kept getting the unhandled promise rejection error. Then I found this thread and updated the firmware to 1v90.5. However, that didn't solve my problem.
To make sure it wasn't something dumb on my part, I copied and pasted the code from the Controlling Other Pucks example (from the "Making it Faster" section). After pressing the button roughly 25 - 30 times I either get the error or no error displays in the console but the master puck stops controlling the other puck. The puck itself is still responsive to console commands, so it doesn't appear to be freezing or anything strange like that. My best guess is that the busy variable gets set to true and never reset when the error occurs so the code in the body of the sendToggle function is never executed. That doesn't help understand the error, though.
For completeness, the console looks like this once the error occurs:
Uncaught error: Unhandled promise rejection: undefined
at line 34 col 47
...tic.writeValue("toggle()\n").then(function() {
^
in function called from system
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: I think there is still something going on. I had been banging my head against my table trying to get one of my pucks controlling the other via bluetooth and kept getting the unhandled promise rejection error. Then I found this thread and updated the firmware to 1v90.5. However, that didn't solve my problem.
To make sure it wasn't something dumb on my part, I copied and pasted the code from the Controlling Other Pucks example (from the "Making it Faster" section). After pressing the button roughly 25 - 30 times I either get the error or no error displays in the console but the master puck stops controlling the other puck. The puck itself is still responsive to console commands, so it doesn't appear to be freezing or anything strange like that. My best guess is that the
busy
variable gets set totrue
and never reset when the error occurs so the code in the body of thesendToggle
function is never executed. That doesn't help understand the error, though.For completeness, the console looks like this once the error occurs: