Hi,
I just got my Pucks and decided to start playing with them, I'm really impressed and I really like the quality of the hardware and how easy/smooth it was to get up and running.
Following the tutorial Controlling Other Pucks I ran into an error:
Uncaught Error: Unhandled promise rejection: undefined at line 34 col
26 txType.writeValue('Puck.js d5b2').then(()=>{ in function called
from system
The code runs perfect initially, but when I click the central Puck after a couple minutes of inactivity I get the previous error. I wont post the source code since it's a copy paste from the tutorial.
I find the error message confusing since the Promise seems to be handled?
txCharacteristic.writeValue("toggle()\n").then(function() {
digitalPulse(LED2, 1, 500); // light green to show it worked
busy = false;
}).catch(function() {
digitalPulse(LED1, 1, 500); // light red if we had a problem
busy = false;
});
The peripheral Puck seems to be working OK. I modified the source to handle manual press
var on = 0;
function toggle() {
on = !on;
digitalWrite(LED, on);
}
setWatch(toggle, BTN, {edge:'rising', debounce:50, repeat: true});
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.
Hi,
I just got my Pucks and decided to start playing with them, I'm really impressed and I really like the quality of the hardware and how easy/smooth it was to get up and running.
Following the tutorial Controlling Other Pucks I ran into an error:
The code runs perfect initially, but when I click the central Puck after a couple minutes of inactivity I get the previous error. I wont post the source code since it's a copy paste from the tutorial.
I find the error message confusing since the Promise seems to be handled?
The peripheral Puck seems to be working OK. I modified the source to handle manual press