• Hey Gordon,

    I finally did all the coding for my 16 channel PWM, now there are a few hiccups left so solve.
    To understand what I'm doing: I control 16 LED stripes from my espruino pico, that fade in one by one and after a little wait they fade out again.
    13 pins are hardware PWM and 3 are software only.
    I use setInterval with an interval of 15 to trigger the fading function, which increases the pwm value of the current channel and then analogWrites that value to the pin.
    If the pin is software then I do
    analogWrite(pin, value, { freq: 600, soft:true, forceSoft:true });
    I tried different frequencies, but 600 seems like a good compromise, with lower values the fading flickers and with higher values all lighted soft-PWM pins flicker when changing the value of one soft-PWM pin.
    But even with a value of 600 sometimes when fading in another soft-PWM pin, the others flicker and once in a while one of the other soft-PWM pins turns off completely for a short amount of time and then turns on again (without any software sending a new value to that pin).

    Any idea how this may be solved? Or is a freqency of 600 on 3 pins too much for the CPU to handle?

    Thanks in advance,
    Marc

About

Avatar for Marc @Marc started