Currently the puck is right next to the MacBook, maybe 15 cm away. When I come to actually use it, however, it will be on top of a table with a Raspberry Pi 3 underneath the table, maybe 40cm away.
I'll have a look at the NRF.setTxPower function and see if that helps. How would I go about increasing the advertising rate? Currently I'm just calling NRF.setAdvertising() once, should it be inside a setInterval to call it repeatedly?
Regarding the button presses, I'm currently doing the same sort of thing as knolleary suggested, which is to advertise 0, increment to 10 on first push, 20 on second etc, then reset to 0 after a few seconds. Maybe I will try having a basic counter that increments the number by 1 on each press, then just look for increases in my node script. At least I can guarantee that I'll notice the button press, no matter how long it takes.
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.
Currently the puck is right next to the MacBook, maybe 15 cm away. When I come to actually use it, however, it will be on top of a table with a Raspberry Pi 3 underneath the table, maybe 40cm away.
I'll have a look at the
NRF.setTxPower
function and see if that helps. How would I go about increasing the advertising rate? Currently I'm just callingNRF.setAdvertising()
once, should it be inside asetInterval
to call it repeatedly?If it's of any use at all, here's a gist of the code.
Regarding the button presses, I'm currently doing the same sort of thing as knolleary suggested, which is to advertise 0, increment to 10 on first push, 20 on second etc, then reset to 0 after a few seconds. Maybe I will try having a basic counter that increments the number by 1 on each press, then just look for increases in my node script. At least I can guarantee that I'll notice the button press, no matter how long it takes.