Most recent activity
-
- 3 comments
- 2,651 views
-
Hi all,
I am using puck.js in advertising mode with the firmware version 2v01 an I am pretty new in using puck.js. I started with the code:
NRF.setAdvertising({ 0x180F : Puck.getBatteryPercentage() },{name: "puckName", interval: 1000});
I used a constant voltage generator to simulate the drop of the battery level. After I had changed the voltage from 2,9 V to 2,7 V, I waited days along but the puck.js didn't refresh the battery level (it stays 100%). On the other side, if I connect to Espruino Web IDE and upload the code, than the battery level is refreshed immediately, showing some 80% for 2,7 V.
How can I get the puck.js to update the battery level during advertising? Is it possible to configure the interval, like once per day.
I have also tried the solution suggested in this Forum:
NRF.setServices({ 0x180F : { // Battery Service 0x2A19: { // Battery Level readable: true, notify: true, value : [Puck.getBatteryPercentage()] }}},{ advertise: [ '180F' ] });
In this case I get the empty service data (i.e. any battery level shown)
Thank you in advance!
Hi!
Thank you very much!!!
It works!