You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Yes, you could put an IR receiver on the Pi - the Puck isn't that long-range with IR though (around a meter).

    Thing is, a normal IR signal contains a ~9ms start pulse (http://www.espruino.com/Puck.js+InfraredĀ­) and data pulses are usually ~1ms so if you transfer any data chances are it's actually going to be slower than the Bluetooth. You could send a single 1ms pulse but it's not going to be that much faster and you may get false positives.

    You could actually do:

    setWatch(function() {
      NRF.wake();
      setTimeout(function() {
        NRF.sleep();
      }, 100);
    }, BTN, {repeat:true});
    

    This stops Bluetooth advertising and then restarts it when the button is pressed, for 100ms. I just tested and it sends an advertising packet immediately - however there's no guarantee that the packet will get received by the Pi because Bluetooth advertising isn't guaranteed.

About

Avatar for Gordon @Gordon started