Aquarium lighting, multiple PWM channels


Total newbie here... I'm basically looking for some guidance on how to code three independent PWM channels for my DIY aquarium lighting rig. For example, channel 1 would come on at say 10:00am, and fade up from 0 - 100 (0 to 254) over the course of an hour, so basically each step would be 14.75 seconds. Fine if you were using a simple pause statement, but if I want to turn on channel 2 at say 10:15am and fade up from 0 - 100% over 90 minutes couldn't have two pause statements running at the same time as each step would be 21.17 seconds for the latter.

Any ideas how to have three channels running at the same time, plus the ability to read a a RTC and monitor switches at the same time - Don't want much do I :)

The blink without delay sketch should fit the bill

The TimeAlarm library, a part of the Time library, allows you to schedule actions at various times of the day.

See also:,37693.0.html

Thanks for the replies... Need to order some bits for the breadboard and start experimenting soon These Arduino things look more promising than trying to program PICs with PicBASIC pro :)