I am working on a project where I will be controlling (on/off/dimming) many light bulbs (up to 70). I found out the way to do this is with PWM. So, I need a lot of them. I don’t think I can multiplex (demultiplex) because they need to latch, right? is there a way that I can program all the digital I/O’s on the arduino to be PWM’s?
The hardware only supports PWM on certain pins.
Somebody made a library to do a software emulation of PWM on any digital I/O pin, but it’s going to have speed or performance limitations.
Thanks, will look into that library.
If that library doesn’t provide the performance you need, have a look at one of the external PWM chips like the TLC5940. http://focus.ti.com/docs/prod/folders/print/tlc5940.html
The TLC594* chips are nice, but they have the unfortunate property that they need to be reloaded with the desired PWM values every cycle. If you are clever, you can recirculate the data without reloading it from the uC every cycle, but that takes a little extra doing. Their output is also not phase-correct, i.e. the phase of the output waveform shifts when you change the value. This may or may not matter in your application, but it is something to consider.