Comments (1)
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)
- Warning in pin comparison
- Please add the test circuit HOT 3
- Please, add STOP/RUN command on demand HOT 13
- external interrupt for zero crossing? HOT 8
- doesn't work with Robotdyn AC Dimmer HOT 22
- Output compare interrupts do not correctly configure clear on output compare.
- Allow using only a single channel. HOT 8
- Pulse ends before triac becomes triggerable for very small phase offsets.
- Support for more chips/boards. HOT 1
- Investigate waveform asymmetry.
- Need to work with ESP32 Please Help ?? HOT 1
- Use with potentiometer? HOT 2
- Unstable operation using the motor instead of the bulb HOT 18
- Correct For Drift Automatically in ISR
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from triacdimmer.