Avatar for Neil_

Neil_

Member since Mar 2020 • Last active Mar 2020
  • 1 conversations
  • 4 comments

Most recent activity

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

    Hi Gordon,

    I've attached the screen shot from my iPad plus my code in case anything might be causing it in there! I have tried playing with the NRF.setServices values to see if it makes any difference but still the same result.

    NRF.setAdvertising({}, {name: "Zoom Remote"});
    var kb = require("ble_hid_keyboard");
    
    // NRF.setServices(undefined, { hid : kb.report });
    
    var services = {
      0x180a: {
        0x2a50: {
          value:     [
            0x01,           /* Use USB Vendor IDs */
            0xac, 0x05,     /* Apple */
            0x5a, 0x02,     /* Internal Keyboard */
            0x00, 0x00
          ],
          readable:  true,
        }
      }
    };
    
    NRF.setServices(services, {
      advertise: [ 0x180a ],
      hid: kb.report
    });
    
    function btnPressed() {
      // Send 'Command + Shift + A'
        kb.tap(kb.KEY.A, kb.MODIFY.LEFT_GUI | kb.MODIFY.SHIFT);
        // Now toggle LED status
        swap();
    }
    
    // keep track of the LED status on button pushes
    var LED_toggle = 1;
    
    function swap() {
      // determine to turn RED LED on/off
      switch(LED_toggle) {
        case 1:
          LED1.write(1);
          break;
        case 2:
          LED1.write(0);
          break;
      }
      // determine the LED status on/off
      LED_toggle = Math.wrap(LED_toggle, 2) + 1;
    }
    
    // trigger btnPressed whenever the button is pressed
    setWatch(btnPressed, BTN, {edge:"rising",repeat:true,debounce:50})­;
    

    Many Thanks
    Neil

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

    Thank you Gordon for your response,

    Apologies JS is relatively new to me, but your tip on just using MODIFY was just what was needed, once i figured out how to concatenate the keys it worked liked a charm for me.

    I have one remaining issue in that my iPad now warns me in bluetooth settings, when the Puck is connected to it, I'm guess its not a recognised bluetooth vendor ID or something?

    Error on iPad
    Using puck.js may affect Wi-Fi and Bluetooth connectivity.

    Very pleased with the Puck.js have many more ideas for it!

    Many thanks
    Neil

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

    Thanks Robin appreciate the links I'll take a look at these, this evening I have updated the module "ble_hid_keyboard.js" locally to add the keys i need but my Web IDE on Mac doesn't seem to have projects under settings for me to load local modules!

    Thanks again for your help

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

    Hi there,

    I bought a puck the other day to learn about JS, and thought my first project would be to try and make a remote mute button to use with Zoom conferencing on my ipad, I found that Zoom lets you use a keyboard shortcut "command + shift + A" so as it's an apple device it requires the command key which is equal to the Windows button on a PC.

    In the module ble_hid_keyboard.js i can see no reference to the Windows key so was wondering how I would go about coding this, assume the module would need to support this?

    Appreciate any ideas

    Many Thanks
    Neil

Actions