You are reading a single comment by @tronic98776 and its replies. Click here to read the full conversation.
  • I'm having trouble getting this to work. For eaxample here is what I'm trying to write to .boot0 and have it execute on device start-up, but it's not working for me:

    require("Storage").write(".boot0", `
    //function onInit() {
    var kb = require("ble_hid_keyboard");
    NRF.setServices(undefined, { hid : });
    function btnPressed() {
      // Send 'm'
      kb.tap(kb.KEY.M, 0);
      digitalWrite(LED3, true);
      setTimeout("digitalWrite(LED3, 0);", 100);
    // trigger btnPressed whenever the button is pressed
    setWatch(btnPressed, BTN, {edge:"rising",repeat:true,debounce:50})­;

    So i have nothing in save(), so do not enter the save() command into the terminal, I just send the above code onto the puck via the IDE, then disconnect from the IDE and restart the puck by cycling the power.

    I have tried both including the onInit and leaving it commented out as above.

    Do I have something wrong, or is it something to do with the ble_hid_keyboard service not working from boot0?


Avatar for tronic98776 @tronic98776 started