• Hi Guys,

    Movement detection code from above is uploaded on Puck with firmware 1v91, but it does not detect any movement. Please advice.

    //7f:9a Motion detector code
    digitalPulse(LED1,true,1000);
    pinMode(D1, 'input_pulldown');
    pinMode(D30, 'input');
    var state=0;
    
    NRF.setTxPower(4); // Full Power advertising
    
    function motion(){
      digitalPulse(LED3,true,100);
      advertise(1);
    }
    
    function reset(){
      digitalPulse(LED2,true,100);
      advertise(0);
    }
    
    function advertise(pinState){
      console.log(pinState);
      state = pinState;
      NRF.setAdvertising({
        0x2a00 : [state]
      });
    }
    
    setWatch(motion, D1, {repeat:true,edge:'rising',debounce:100});
    setWatch(reset, D1, {repeat:true,edge:'falling',debounce:100});
    

    Thank you.

About

Avatar for user73560 @user73560 started