I'm using arduino Mega. I have 10mm green led connected via the Anode leg to each arduino digital pins between D2 to D62 with 1k resistor to ground via Cathode leg. I have no schematics to show.
I would like to control each led of those 60 individual leds independently .
I was thinking to write an array of pattern for each led but it will be very long array for 60 leds and 15 minute sequence.
here is an example of 16 leds and 29 seconds:
#define N_LEDS 16 //number of LEDs
#define N_STATES 29 //number of pattern states
bool pattern[N_LEDS][N_STATES] =
{ //required display pattern
{1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0}, //LED01
{0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0}, //LED02
{0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0}, //LED03
{0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0}, //LED04
{0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0}, //LED05
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0}, //LED06
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0}, //LED07
{0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0}, //LED08
{1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1}, //LED09
{0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,}, //LED10
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0}, //LED11
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0}, //LED12
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0}, //LED13
{0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1}, //LED14
{0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, //LED15
{0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0} //LED16
};
const int LED_PIN[16] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18}; /
void setup() {
for(int i=0; i<N_LEDS; ++i)
pinMode(LED_PIN[i], OUTPUT);
}
void loop()
{
for(int pattern_state=0; pattern_state<N_STATES; ++pattern_state)
{
for(int j=0; j<N_LEDS; ++j)
{
digitalWrite(LED_PIN[j], pattern[j][pattern_state]);
}
delay(1000);
}