Delay controlled relay sketch issues

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

From what I gather you want;
If input is LOW, output is LOW
When input goes HIGH, output goes HIGH.
When input goes LOW, output stays HIGH for countdown of 30minutes, then goes LOW.

THE ISSUE: If pin 2 goes HIGH again while countdown is working, pin 12 goes HIGH and if pin 2 goes LOW, the countdown resumes and dont start counting 30 mins from the beginning.

In this case if you are counting down when input goes HIGH again, isn't your output already HIGH. because you are counting down?

What do you want to have happen if input goes HIGH and then LOW again, if the countdown is counting and output still HIGH?

Tom... :slight_smile: