Thanks - I'll look into this. Just did a quick check and:
function onTimer() {
analogWrite(LED1,0.01,{freq:50})
}
var i;
setInterval(function() {
if (i) {
clearInterval(i);
i = undefined;
} else i = setInterval(onTimer,10);
}, 1000);
You'd expect the LED to stay the same brightness. If you don't specify a frequency then it's fine so I assume that it's resetting the frequency even when there's no need.
Is there any other way with more low level control to update PWM's values?
Yes, there is - you could actually look at the nRF52832 reference manual and then poke values directly into the timer peripheral after it is set up.
Hopefully I'll be able to get this fixed pretty quickly though.
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.
Thanks - I'll look into this. Just did a quick check and:
You'd expect the LED to stay the same brightness. If you don't specify a frequency then it's fine so I assume that it's resetting the frequency even when there's no need.
Yes, there is - you could actually look at the nRF52832 reference manual and then poke values directly into the timer peripheral after it is set up.
Hopefully I'll be able to get this fixed pretty quickly though.