You are reading a single comment by @ChristianW and its replies. Click here to read the full conversation.
  • From which side - central or peripheral?
    If you're the central you are the one who initiates the connection, so you should be able to increment a counter when this happens.

    EDIT:
    From peripheral side there are events for connect and disconnect:
    https://www.espruino.com/Reference#l_NRF­_connect
    https://www.espruino.com/Reference#l_NRF­_disconnect

    This example will flash the green LED on connect and the red on disconnect:

    NRF.on('connect',()=>{
      digitalPulse(LED2,1,200);
    });
    NRF.on('disconnect',()=>{
      digitalPulse(LED1,1,200);
    });
    

    It's easy to try with just the WebIDE as connecting central.

About

Avatar for ChristianW @ChristianW started