Issue resolved :)
I tried a digital pin without any success :(
I tried an other HC-SR501 and it worked. So my sensor was definitely broken.
here the code that's working :
setWatch(function() { console.log("Movement detected at : ", Math.floor(Date.now() / 1000) ); }, NodeMCU.D6, {repeat:true, edge:"rising"});
@Antoine started
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.
Issue resolved :)
I tried a digital pin without any success :(
I tried an other HC-SR501 and it worked. So my sensor was definitely broken.
here the code that's working :