• I'm trying to setup my puck as a single button keyboard to send a character (or two) when the button is pressed, I'm not having much luck and struggling with how to debug it, as I understand it I have to disconnect the web bluetooth IDE before the puck can connect as a keyboard?
    I've flashed the code below to the puck then disconnect and press the button, the BLUE LED comes on for 10sec then the red one flashes as I would expect indicating its failed, I've tried scanning for new bluetooth devices (keyboards) from my Mac and iPhone after I disconnect but nothing is found.

    var kb = require("ble_hid_keyboard");
    NRF.setServices(undefined, { hid : kb.report });
    var reset_timer;
    
    function sendKB(){
      LED3.set();
      kb.tap(kb.KEY.H, kb.MODIFY.SHIFT, function() {
        kb.tap(kb.KEY.i, 0);
        });
      clearTimeout(reset_timer);
      LED2.set();
      setTimeout("LED2.reset()",1000);
      LED3.reset();
    }
    
    function onTimeout() {
      setTimeout("LED1.reset()",1000);
      LED1.set();
      LED3.reset();
    }
    
    setWatch(function() {
      reset_timer = setTimeout("onTimeout()",10000);
      sendKB();
      }, BTN, {edge:"rising", debounce:50, repeat:true});
    

    I'm running 1.9.1 on my puck, updated to that this morning

About

Avatar for sammachin @sammachin started