Most recent activity
-
- 19 comments
- 4,922 views
-
-
-
-
Hey Gordon,
I have a strange phenomenon with setWatch. The Code:
clearWatch();
setWatch(demo, BTN1, {repeat:true, edge:'falling', debounce:50 });
The demo() function just does some LED blinking.When pressing the button the watchfunction runs once most times, but sometimes twice and in rare cases it even loops forever without stopping.
Sometimes i only have to move my finger on the button without pressing it and the demo function runs.
I tried all kinds of parameter combinations, but did not find one that works once every time the button is pressed.
Any idea?Thanks in advance,
Marc -
-
-
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