You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • 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.

About

Avatar for Gordon @Gordon started