You are reading a single comment by @user76916 and its replies. Click here to read the full conversation.
  • I have an application where the Puck sends data through BLE write on another device.
    To reduce power consumption even more, I tried turning off NRF by NRF.sleep() (The example here works https://github.com/espruino/EspruinoDocs­/blob/master/puck/Puck.js%20Security.md#­disable-bluetooth)

    However, when I modify the code to enable sleep after performing some action, the Puck lights up all 3 LEDs and my function does not work again. Here is a sample pseudo code -

    var locked = 0;
    setWatch(function(){
    NRF.wake();
    digitalPulse(LED2, 1, 50);
    /*
    do something here
    */
    setTimeout(() => NRF.sleep(), 1000); // turns on all 3 LEDs briefly and resets.
    }, BTN, {repeat:true, edge:"rising", debounce:50});

    Any suggestions why is this happening ?

About

Avatar for user76916 @user76916 started