Avatar for Deas

Deas

Member since Apr 2015 • Last active Nov 2019
  • 4 conversations
  • 19 comments

a Espruino Pico Kickstarter Backer.

Most recent activity

    • 3 comments
    • 1,478 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for Deas

    I've done some more research and according to various websites, 219 could also be either Windows key, square open bracket ("[") or curly open bracket ("{").

    Neither of these seems to be included in the ble_hid_keyboard / ble_hid_controls.
    I'm sure I'd have to create my own report but have no idea about that stuff. I would ideally use ble_hid_controls because it contains already controls for vol, etc.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Deas

    Hi, I'm working on a project and was wondering how i could send bluetooth keycode 219,
    I haven't been able to replicate this info using the Puck.js- I attempted to use the default HID report provided in the tutorial and then using the low-level to try send 219.

      controls = require("ble_hid_controls");
      NRF.setServices(undefined, { hid : controls.report });
      NRF.sendHIDReport([0,0,219,0,0,0,0,0], ()=>{ 
        NRF.sendHIDReport([0,0,0,0,0,0,0,0], ()=>{}); // reset
      });
    

    Suggestions much appreciated !

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Deas

    Hmm.. I'm not entirely sure the keyboard library works now.
    I am having no luck with getting even the bluetooth keyboard example to run.

    However the media controls works instantiations after reconnecting.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Deas

    @Gordon what does

    BLE Connected, queueing BLE restart for later
    actually entail? How does one restart BLE? reconnect from the computer? pull the battery?

    I'm having issues with getting it back into the right "mode" for the keyboard to do something other then throwing exceptions with the code above. with or without kb.tap().

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Deas

    Yes, i am using the latest, 1v92 firmware.
    I haven't been keeping up with the updates so i flashed it before doing this.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Deas

    Hi, sorry for hijacking the thread, but..

    I am having similar problem with the BLE, where i have disconnected from the puck, removed the battery and inserted it again, etc.

    What i'm basically is trying to do is a hold-button and release after ½ second.
    Since this isnt inlcuded in the "ble_hid_keyboard" library, i created my own based upon "tap" function in said library.(1)

    
    var keydown = function(keyCode, modifiers, callback) {
      NRF.sendHIDReport([modifiers,0,keyCode,0­,0,0,0,0], function() {
        if (callback) callback();
      });
    };
    
    var keyrelease = function(keyCode, modifiers, callback) {
      NRF.sendHIDReport([0,0,0,0,0,0,0,0], function() {
        if (callback) callback();
      });
    };
    // ......
    
    var kb = require("ble_hid_keyboard");
    NRF.setServices(undefined, { hid : kb.report });
    
    function btnPressed() {
      ledBlink();
    //  kb.tap(kb.KEY.A, 0, function() {});
      keydown(kb.KEY.F12);
    }
    
    // trigger btnPressed whenever the button is pressed
    setWatch(btnPressed, BTN, {edge:"rising",repeat:true,debounce:50})­;
    
    function ledBlink() {
      LED1.write(true);
      setTimeout(function() {
        LED1.write(false);
        keyrelease();
      }, 500);
    
    }
    enter code here
    

    the error i get back is "Uncaught Error: BLE HID not enabled"
    is there a way to check if it is in BLE HID mode before trying to do anything, so ie. i can restart the puck or light up a led to tell me that it isnt ready (besides catching said error in a try-catch)?

    [1]

  • in Interfacing
    Avatar for Deas

    Anyone know what state / brk is for>?

    • 6 comments
    • 2,492 views
  • in Interfacing
    Avatar for Deas

    Ok, now I've confirmed that, Yes, that does happen on Serial1, While Serial2 give undefined.

    e; Wowsers! Serial2 responded! :D

Actions