Giter VIP home page Giter VIP logo

Comments (1)

AJMansfield avatar AJMansfield commented on August 27, 2024 3

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.)

from triacdimmer.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.