I've just had a go at this, and measure 0.2mA when connected, 0.03mA when not, 5mA ish when the red LED is on - as you'd expect.
But then if I simply type NRF.sleep() I measure 0.03mA as if it's advertising - checking on it, it looks like it is still advertising... so there's something really odd going on there.
If I do this:
function on_disconnect() {
NRF.sleep();
}
NRF.on('disconnect', on_disconnect);
(including adding a flash) I get the same thing for some reason.
However if I run your code I do get the 3mA power draw.
I'd be a bit careful about the readings you get from just a meter (I use a capacitor across the meter to try and reduce any peaks of power draw) but even so, something odd seems to be happening in your case, and I'm not sure why.
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've just had a go at this, and measure 0.2mA when connected, 0.03mA when not, 5mA ish when the red LED is on - as you'd expect.
But then if I simply type
NRF.sleep()
I measure 0.03mA as if it's advertising - checking on it, it looks like it is still advertising... so there's something really odd going on there.If I do this:
(including adding a flash) I get the same thing for some reason.
However if I run your code I do get the 3mA power draw.
I'd be a bit careful about the readings you get from just a meter (I use a capacitor across the meter to try and reduce any peaks of power draw) but even so, something odd seems to be happening in your case, and I'm not sure why.