The Planted Tank Forum - View Single Post - Improved Arduino LED lighting code
View Single Post
Old 09-09-2011, 02:34 AM   #9
sink
Algae Grower
 
PTrader: (2/100%)
Join Date: Jun 2011
Location: Boston, MA
Posts: 148
Default

Quote:
Originally Posted by O2surplus View Post
Sink,

I loaded the code into my Duemilanove and connected it up to my Cat4101's, Looks good so far. I made some changes to the code to run the leds at max (1023) all day,and set the night time level to a minimum (20) for moon lighting at night. I think a pwm value of 20 works out to be a hair less than 2%. I should know by 10pm whether or not the leds will continue to run at such a low setting.
Your LEDs should run all the way down to a setting of 1 without any problems. The CAT4101s OTOH don't seem to have particularly precise dimming below about 1% though it will still work. I've lowered the default PWM frequency from 500Hz to 150Hz in an effort to improve that so I'm curious to see how your results are.

Quote:
I did notice that there's something amiss with the time display in the serial monitor. The time displayed is 1 hour less than the correct time on my PC. Any idea what's causing that? Must be something to do with the DS1307 and daylight savings time?
That's an interesting one. The DS1307 is completely naive of timezones so the issue would be with the time your computer is putting out somehow not compensating for DST. I presume you set the clock using the timerset.pde sketch?
sink is offline   Reply With Quote