Go Down

Topic: Aquarium lighting, multiple PWM channels (Read 811 times) previous topic - next topic

malc-c

Hi,

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

Headroom

http://trippylighting.com

http://ledshield.wordpress.com/

Chagrin

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

See also: http://arduino.cc/forum/index.php/topic,37693.0.html

malc-c

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

Go Up