• Got this to work per your first suggestion. THANK YOU!
    Any way to speed the sending of the buttonpress ?
    Left in the console logging/press count for debugging to see if it really is working.

    var buttonState = false;
    var whichLED;
    var presses = 0;
    
    setInterval(function () {
      console.log("starting set interval");
      updateBLE(presses);
    }, 10000);
    
    function updateBLE(presses) {
      console.log("update ble advert " + buttonState);
      NRF.setAdvertising({
          0x1809 : E.getTemperature(),
          0x180F : E.getBattery(),
          0xFFFF : [buttonState],
          0x2A3D : [presses]
       },{interval: 375});
    }
    
    setWatch(function() {
      buttonState = !buttonState;
      whichLED = buttonState != 1 ? LED3 : LED2;
      digitalPulse(whichLED, 1, 500);
      console.log("pressed");
      presses++;
      updateBLE(presses);
    }, BTN1, { repeat:true, edge:"rising", debounce: 25 });
    

    -Katherine

About

Avatar for kab @kab started