IR remote coding guidance

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

the LED must get out of delay loop

The LED can't possibly be in a delay loop. The delay() function does not loop. Hardware doesn't loop.

I get really tired of pointing out the obvious. DO NOT USE delay(). Ever. The blink without delay example shows how to do something some fixed period of time after another event, like turning the LED off after it was turned on.

Could any one suggest ,how to modify the below code fulfilling the condition in which we can interrupt the delay

Interrupting the delay() will be useless, since, after the interrupt, delay() will resume. The trick is to NEVER call delay(). Then, there is no need for contortions to get out of the delay().

And, you seem to have forgotten the code...