You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It may be possible to adapt this for more than two channels, depending on what hardware you intend to run it on.
The two-channel limit is not actually a software limit; it's a limit of the underlying timer/capture peripheral that this library is written around. Only one of the three timer peripherals on the atmega328p (e.g. arduino uno) has the input capture function this library requires, and that timer only has two channels — so as far as I know there isn't a way to get that chip specifically to drive more than two channels, without compromising on sub-microsecond accuracy and introducing significantly more complexity.
However, atmel does make chips that could: for instance the atmega2560 (e.g. arduino mega) has five compatible timers with three channels each, so you could drive up to 15 dimmer channels from that chip. I don't yet have code that actually implements this functionality for the additional timers and channels, but it wouldn't be difficult to add if there's demand.
Alternately, you might also want to check out the Dimmable Light library, which does more-or-less exactly the same thing this library does — it's just a lot more flexible about platform compatibility and pinout selection, at the cost of marginally worse timing performance and CPU footprint. That library didn't exist when I originally wrote this one, and if I had a project that called for dimming some lights these days I'd probably use their library now too rather than my own too. (I'd only bother with this one if timing performance was really critical or I was trying to dim a more unusual source like 400 Hz military/aviation power.)
I can see that there are a limitation for controlling only 2 channels.
Is it possible to adapt this library to control boards with >2 channels, for example Krida 8CH Dimmer board?
If yes, could someone point me to the direction what needs to be updated in code and what are the challenges?
The text was updated successfully, but these errors were encountered: