Most recent activity
-
Hi! I'm trying to read data from the puck.js over web bluetooth. As a PoC I just wanted to read the battery percentage, but it doesn't work: The Puck.js does not appear on the list for the bluetooth devices in the web browser. My assumption is, that the web bluetooth library does not know, that my puck is advertising battery data.. Any idea how to fix this?
The code on my Puck.js:
NRF.setServices({ 0x180F : { // Battery Service 0x2A19: { // Battery Level readable: true, notify: true, value : [Puck.getBatteryPercentage()] }}}); setInterval(function(){ NRF.updateServices({ 0x180F: { 0x2A19: { value : [Puck.getBatteryPercentage()] } } }); }, 60000);
For testing purposes I used the Web Bluetooth Sample page: https://googlechrome.github.io/samples/web-bluetooth/battery-level.html
-
-
Hi @Gordon
How did you test the advertising? I'm trying to test it using a WiPy and the nRF connect app, but I don't see any data.
-
-
Hey guys!
I want to check if the sliding door of my terrarium is closed using the Puck.js (light green LED if it is closed, else light red LED). I found a cool tutorial, where I can see how to do this using a magnet.
But I think a better solution would be to attach 2 wires to the Puck.js and then put a metal plate on the side of the door. If the door is closed, the circuits is also closed and otherwise it's open.
I'm not very familiar with the Puck.js so far, so I have two questions for this idea:
- To which pins should I connect the two wires?
- How can I determine, if the two wires are connected or not?
Thanks for your help!
- To which pins should I connect the two wires?
Hi Gordon!
Thanks, this works. :-) Regarding where to put some info on this: It would be great to have a tutorial, using the Puck.js together with the web bluetooth API (not only with your wrapper class).
Now, I have some other questions regarding this: