tronic98776
Member since Mar 2019 • Last active Mar 2020Most recent activity
-
-
I'm looking for a way to disable the hard-reset that is initiated by holding down the button on power up to clear out any previously saved code and bonding data. Is there a command I can add into my code that will prevent this function?
I understand there are certain risks with doing this but I want to prevent the chance of erasing the code accidentally.
I would like to still have the self-test function intact where you can power up the puck without loading the saved code and without deleting the saved code.
many thanks
-
Thanks for your help.
I've found a workaround, it functions, but its not ideal and I doubt it's very efficient in terms of battery power. I check the RSSI (Signal Strength), and illuminate the LED depending on the result:
NRF.setRSSIHandler(function(rssi) { sigStrength = rssi; }); function checkRssi() { if (sigStrength > -51){ digitalWrite(LED1,1); } else {digitalWrite(LED1,0); } } function myFunction() { myVar = setInterval(checkRssi, 3000); } myFunction();
-
Thank you for your reply Robin
But I had looked previously at those sections, and I have looked at the tutorials and can't find a relevant one. I'm not sure what I'm missing in the documentation you linked to, could you please be more specific.
Perhaps I didn't explain what I wanted to do, I know how to make the LEDs turn on and off, but I want to trigger an LED when a Central device connects to my Puck via BLE using the active Ble HID keyboard service. I am able to connect to the Puck and use it to send keyboard commands to the central device, but I want the connection to trigger a function (like illuminate an LED on the Puck).
Thank you.
-
Hello
I'm using a puck as a ble HID keyboard with NRF.setServices(undefined, { hid : kb.report }); based on this Tutorial:
https://www.espruino.com/BLE+KeyboardWhat I'm looking for is a way to test if it is connected via bluetooth or not, for example to illuminate one of the LEDs when connected.
I've looked through the documentation and searched the forum, but can't find anything.
Help appreciated.
Thanks
-
- 9 comments
- 3,629 views
-
OK, thanks @Gordon, so I think I understand the problem and why it won't work with the firmware as it is.
It seems from this that what you want is actually a lot simpler than that.
I'm afraid not.
I assumed you wanted to be able to connect with another device while stopping the phone connecting
This is correct. I want to connect the Puck to Phone A, send an HID string to it based on x-event, then, based on y-event I want the Puck to disconnect from Phone A or power-down and then be discoverable and able to connect to Phone B without Phone A ever auto-reconnecting.
I assume that using an E.on function as well as an onInit won't solve my problem? as they are essentially the same thing?
Is there a way to set the Puck to connect without bonding? Would that even work?
Is there a way other than changing the MAC address of making the Puck appear to be a different/unknown device to a previously paired Phone?
Can you think of any other ways around this other than a firmware update?
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:
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?