I've been following this post and got my last piece this weekend and the controller is up and running. Thanks for everyone's input, especially ketchupoy.
One question. Does anyone know how to program for the "P" and make it smoother (0-255) instead of the steps in the current sketch?
for (int i = 1; i <= whiterampup; i++)
analogWrite(white, int (i/whiterampup*255))
int countdown = 60 ;
I've been following this post and got my last piece this weekend and the controller is up and running. Thanks for everyone's input, especially ketchupoy.
One question. Does anyone know how to program for the "P" and make it smoother (0-255) instead of the steps in the current sketch?
Just ordered a 4 5v relay board off ebay with my ebay bucks ive earned lol good ole ebay paying me back.
for (int i = 1; i <= whiterampup; i++)
analogWrite(white, int (i/whiterampup*255))
int countdown = 60 ;
Molehs, you are casting to integer after the calculation, that's probably why you're getting a 0.
(the 'int' word in your analogWrite)
EDIT: I'm not saying you shouldn't cast, just that you're probably getting some fraction from some miscalculation, thus the 0)
EDIT2: I'd strongly recommend that you look at the map function for sunrise/sunset. It doesn't lock your sketch like your for loops do. You can see examples of it in the other two controller firmwares and the arduino sketches thread.
or (int i = 1; i <= whiterampup; i++)
float currentramp = float(i/bluerampup);
analogWrite(white, (currentramp*255))
int countdown = 60 ;
Map function? Sorry very new to this where in which thread?
http://www.arduino.cc/en/Reference/map
The other two controllers I was referring to are:
http://reefcentral.com/forums/showthread.php?t=1783536
and
http://reefcentral.com/forums/showthread.php?t=1847680
The second one is simpler so it might be easier for you to extract the fading code.
The Arduino sketches thread also has that:
http://reefcentral.com/forums/showthread.php?t=1831741
I've been following this post and got my last piece this weekend and the controller is up and running. Thanks for everyone's input, especially ketchupoy.
One question. Does anyone know how to program for the "P" and make it smoother (0-255) instead of the steps in the current sketch?
For the 1k resistor does Watts matter? Got a 1w and a 1/2w.