-
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 !
-
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.
-
@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().
-
-
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)? -
-
-
Yes, I am using Serial1.
I2C1.setup({scl: B6, sda: B7}); // NFC module Serial1.setup(9600, { rx: A3, tx : A2 }); // BLE module
e; will try both when i get back home;
e2; while thinking about it a bit closer, the error might have came up when i tried Serial2, because Serial1 wasn't giving me any response. -
Hi; just received my HM10 BLE module, and I'm getting this error when trying to use A3 / A2 as RX/TX
ERROR: Pin A3 is not capable of USART RX Suitable pins are: A10 B7
when the image on the pico clearly says those are available.
The thing is that B7 and B6 is taken for my NFC module atm.How can i make it use the USART2 ?
Also, not sure about the other wirings, so I've only connected gnd/vcc/rx/tx for now, to see if i can get it working or not, I've only had it for ~20 min -
-
-
Alright, thanks for the info/help- I managed to get it work, I'm not sure on which made it work, but, I updated firmware (was on 1v77), took everything off the breadboard, put them back in and double and tripple checked everything and boom, we have liftoff!
e; oh and i even replaced the resistors.
e2; oh and, yes the address should have been '0x48 >> 1', but like i said, nothing was working, so, didn't really matter at the point. -
-
Hi, I'm getting some errors on attempting to connect to the PN532 module w/ Pico
cutting it down to the basics:
I2C1.setup({scl:B6, sda:B7}); I2C1.writeTo(0x50,[0,0]);
And this happens:
Uncaught InternalError: Timeout on I2C Write BUSY at line 1 col 24 I2C1.writeTo(0x50,[0,0]);
I'm not sure why this happens, maybe I connected it poorly?
-
-
-
Hi, I think I might have broke the pico I received a few days ago.
I was attaching the pico to unsoldered wires on GND and VCC (or was it 3v?) and an error messaged appeared on my macbookair saying that usb was drawing too much power and it did something about it (i didn't look, as it was very similar to another error I receive often with my prettymuch constantly attached SDcard randomly disconnecting), and after that the pico does not seem to react on inserting (that quick red led blink) nor showing up on serial port.Holding down the button on trying to go into bootloader does not respond either.
I've tried rebooting to no vail.
suggestions?
-
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.