I'd do NRF.setAdvertising({0xFFFF:[0]}); rather than sending an actual string, and NRF.setAdvertising({0x180F : [Puck.getBatteryPercentage()]}); as is done in the examples - your way might work, but providing the array is more explicit about what you want to send (one byte, not a string of characters).
But yes, that'd work fine - although I'd still recommend that you use the counter method if you want to be sure you don't miss things happening.
So in this code, LED1 is not an output, so I shouldn't have to do a read correct?
I think it is an output by default - just stick digitalRead(LED1) right at the end of your code and you'll be sorted.
The only reason you suggested bumping power with setTxPower(4) is just to give me some more distance correct?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'd do
NRF.setAdvertising({0xFFFF:[0]});
rather than sending an actual string, andNRF.setAdvertising({0x180F : [Puck.getBatteryPercentage()]});
as is done in the examples - your way might work, but providing the array is more explicit about what you want to send (one byte, not a string of characters).But yes, that'd work fine - although I'd still recommend that you use the counter method if you want to be sure you don't miss things happening.
I think it is an output by default - just stick
digitalRead(LED1)
right at the end of your code and you'll be sorted.Correct, yes.