Hi,
i am playing around with the BLE Advertising. It seams to be a little bit unstable.
First: When connected to the Web IDE, Advertising don´t work at all for me. You need to disconnect to test it. Is this by design or a bug?
Second: Button Press is not catched precisely.
i use the following code:
var pressCount = 0; setWatch(function() { pressCount++; NRF.setAdvertising({ 0xFFFF : [pressCount] }); }, BTN, { edge:"rising", repeat:false, debounce:50 });
Setting repeat to true causes on some pucks to repeatingly advertise the counter, on others to only adverstise the counter when button is pressed.
Third: Different Intervals
I set two advertisements within an interval of 3 seconds but the information are advertised in different intervals:
setInterval(function() { NRF.setAdvertising({ 0x2a01 : [String(E.getTemperature())], 0x2a19 : [String(Puck.getBatteryPercentage())] }); }, 3000);
Temperature is advertised every 3s but BatteryPercentage every 1-5 seconds (this vary a bit).
Does anyone has some ideas?
Kind regards
solick
@solick started
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.
Hi,
i am playing around with the BLE Advertising. It seams to be a little bit unstable.
First: When connected to the Web IDE, Advertising don´t work at all for me. You need to disconnect to test it. Is this by design or a bug?
Second: Button Press is not catched precisely.
i use the following code:
Setting repeat to true causes on some pucks to repeatingly advertise the counter, on others to only adverstise the counter when button is pressed.
Third: Different Intervals
I set two advertisements within an interval of 3 seconds but the information are advertised in different intervals:
Temperature is advertised every 3s but BatteryPercentage every 1-5 seconds (this vary a bit).
Does anyone has some ideas?
Kind regards
solick