Ok, great! It may be that E.getPowerUsage() is wrong about analogWrite(LED_R, 0); - I believe that does shut off PWM and so doesn't use power - but anything between 0 and 1 will use PWM.
Even so it doesn't hurt to do LED_R.reset()/digitalWrite(LED_R,0)/etc
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.
Ok, great! It may be that
E.getPowerUsage()
is wrong aboutanalogWrite(LED_R, 0);
- I believe that does shut off PWM and so doesn't use power - but anything between 0 and 1 will use PWM.Even so it doesn't hurt to do
LED_R.reset()/digitalWrite(LED_R,0)/etc