flashy lights ooooh

Hey all,
I'm building a solar powered sign illuminator using a outdoor LED rope and naturally controlled by our loved arduino "mega".

what I want to add to the code is a chunk of stuff to make the indicator light flash faster and faster as the led rope time expires.
anyone know of some simple code to do this? my mind is void looping...

void setup()
{
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
pinMode (12, OUTPUT); // set the socket D12 as an output
pinMode (11, OUTPUT); // set the socket D11 as an output
pinMode (1, INPUT); // set the socket A1 as an input
pinMode (2, INPUT); // set the socket A2 as an input
pinMode (10, INPUT); // set the socket D10 as an input
}

int lifetime = 0;
int buffer = 30;
int led1State = LOW; // set the led rope off
int led2State = HIGH; // set the indicator led on

void loop() {
int ldr = analogRead(1);
int pot = analogRead(2);
Serial.print("LDR: "); Serial.println(ldr);
Serial.print("POT: "); Serial.println(pot);
if (ldr < pot) {
if (lifetime < buffer) {
lifetime += 15;
}
if (lifetime >= buffer) {
lifetime == buffer;
led1State = HIGH;
led2State = LOW;
digitalWrite(12, led1State);
digitalWrite(11, led2State);
}
} else {
if (lifetime > 0) {
lifetime--;
}
if (lifetime <= 0) {
lifetime = 0;
led1State = LOW;
led2State = HIGH;
digitalWrite(12, led1State);
digitalWrite(11, led2State);
}
}

Serial.print("Lifetime: "); Serial.println(lifetime);
Serial.print("LED Rope: "); Serial.println(led1State);
Serial.print("Indicator LED: "); Serial.println(led2State);

if (digitalRead(10) == HIGH) {
delay(5 * 60 * 1000); // 5 Minutes
} else {
delay(1000); // 1 second
}
}

You will never get two events to happen simultaneously (or close) using delay.

During the delay call, nothing happens (except that interrupts get processed).

Start by modifying this code to get rid of the delay calls. Look at the Blink Without Delay example.

Basically, what you need to do is keep track of what time it is now (relative to some event) (that's what the millis function is for) and when some event last occurred (when was the LED last turned on/off). Then, determine if it is time to do something again. If not, do nothing. Otherwise, do something, and update the time when the event last occurred.

Awesome, thanks for that, just looking at the millis function now to see how it works, will let you know how i go.