The Planted Tank Forum - View Single Post - Another Arduino LED light schedule sketch

View Single Post
post #15 of (permalink) Old 05-16-2013, 04:46 AM
AquaPorn
Algae Grower
 
Join Date: May 2013
Location: Chicago Suburb
Posts: 26
Thanks for taking the time man...

Yes I've had that set up from the beginning.

#define CHANNELS 9
#define MAXPERIODS 3

Also changed

int lightValue [CHANNELS] = {0,0,0,0,0,0,0,0,0};

So, those are in place as well as my 9 channels in the lightMatrix.
The code is commented well, and easy enough to adjust to my set up.
That's why I'm stumped as to why it's not working. It compiles fine. Just not getting desired results.

I think I have narrowed it down to the void function. The Intensity value is not being picked up by the lightValue array.
Still hunting...
I removed the pinMode call in setup...I don't think it is necessary as the code uses analogWrite and the LEDs are on pwm pins, but I can try adding that back.

I can also try changing "#define" to "const"...one drawback with using #define is that it replaces anything with the word CHANNELS with the 9 value. That might be my bug, but I doubt it.
Gut is still telling me I have an issue in that void function somewhere. It's just not finding what period it is.

Last edited by AquaPorn; 05-16-2013 at 05:48 AM. Reason: Forgot something
AquaPorn is offline  
 
 
For the best viewing experience please update your browser to Google Chrome