You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I guess you're still connected by Bluetooth?

    It could be because when you're connected by bluetooth it's sending and receiving packets to your PC every (i think) 20ms or so, which could very likely overlap with the advertising packets that it is trying to receive (and that appear only every 300ms or so).

    You could try something like:

    var found = [];
    
    setWatch(function() {
      digitalPulse(LED,1,10);
      NRF.sleep();
      NRF.findDevices(function(devices) {
        digitalPulse(LED2,1,10);
        found = devices;
        NRF.wake();
      }, 4000);
    }, BTN, { edge:"rising",debounce:50,repeat:true });
    

    and you could upload, press the button, then connect again after the 5 seconds and see what was in 'found'?

About

Avatar for Gordon @Gordon started