You are reading a single comment by @fanoush and its replies.
Click here to read the full conversation.
-
I did that too, but it still resulted in the same error message. Here's what I used, in case I made a mistake somewhere.
var n=""; function sig(e) { "jit"; // The data we have received so far // The handler that gets called when the signal changes state // start listening for a change var d = 10000*(e.time-e.lastTime); if (d<2 || d>10) { if (n.length>20) console.log(n); n=""; } else if (!e.state) n+=0|d>5; } function startListening(pin) { "jit"; setWatch(sig, pin, {repeat:true, edge:"both"}); } startListening(A0);
I'll try to see if I can do the count in a bit.
So can you just in case put "jit" into the function definition of
sig
? And if you used parts of https://www.espruino.com/modules/433.js then also in thedecode
function that is called fromsig
there.you can also try to increment some global variable inside sig to know how often it is called