IR remote issue with delay

Dear All,

I am a newbie and a hobbyist in Arduino. I am facing a issue with delay function for a program of IR remote.
Below are the steps how the program must behave:

1 button pressed-LED on
3 Button pressed -LED off.
2 Button pressed LED must be ON for 30 seconds and if 3 button is pressed, the LED must get out of delay loop and must follow the instruction .

Problem Statement- if i press 2 it stays in delay of 30 seconds till then no further instruction could be excecuted.
I heard of Millis function we can use for such delays.Could any one suggest ,how to modify the below code fulfilling the condition in which we can interrupt the delay.

OR_Relay2.ino (760 Bytes)

Did you not read the piece at the top of the Introductory Tutorial section that says

PLEASE DON'T POST YOUR QUESTIONS HERE

...R

Read Robin2's discussion on several things at once: http://forum.arduino.cc/index.php?topic=223286.0

I tried all the combination but it's not working... Could you please helo

Same problem i am getting. Any solution

Achukar: I tried all the combination but it's not working... Could you please helo

Surely you haven’t tried every combination :confused:

Show us your attempts.

ashishpandey:
Same problem i am getting. Any solution

Please start your own thread.

Achukar: I tried all the combination but it's not working... Could you please helo

Does that mean that you wrote a program using millis() following from study of the link in Reply #2?

If so post your program. Without that we have no idea what you have tried.

...R