how to use more than 3 PWM?

hello!
I have a question about PWM.

In one of my projects I need to move up to 20 dc motors and control their speed using PWM (and different speed for each one of the dc motors).

How can I do it with one Arduino board?

By now, I am trying to do it writing pseudo-slow-PWM digital pulses through the other digital pins... but I think that it is not going to be enough...

BR
Qq

I have no idea.

im in the same situation.

i need to control 6 lamps, using pwm. and a lightsensor (that picks up light from the lamps)

all but 1 lamp is active at one time. except during the crossovers where another lamp fades in, and the lamp fades out.

i thought a multiplexer would work, but i just heard that it wouldn't be possible to have fade crossovers, since only One lamp at a time could be controlled.
which would mean full fadeout of one lamp before other fades in. and that would change the whole thing too much...

i thought about using all PWMs to control the lamps, having 2 lamps on one pwm and fadeouts between the other pwms.

(the idea is to use RANDOM aswell... so it randomly chooses a lamp...)

I think what I would do is burn a few atmega8s with the boot loader and then use one as the controller to slave the others. the slaves would control the lights directly and the master controller to control the slaves.

My guess is that you could use a lot of the same external components. i.e. crystal, caps ...

ñ

get an atmega168 or an arduino mini

they support 6 pwm

massimo

Isn't it possible to code your own PWM?

reading - writing multiple pins simultaneously
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1160606668

bf,

technically I bet your right. Wouldn't this be a problem though::: as your code changes length, this would alter the PWM signal.

ñ

as your code changes length, this would alter the PWM signal.

True. I guess it depends on what you want to do with it. It won't work for precision stuff, but it might work sufficiently well for dimming a bunch of LEDs...