Monitor beacon light tower

Hi, I´m trying to make a project where I´m conecting the arduino to two beacon light towers.

I whant to make a OR gate that is trigged when one of the is green light is on more than 20 seconds.

The OR gate is working but trigger also when the beacon light tower is flashing green.

Can some one please help me with this, can i use two if statements after eachother to do this

if input 1 or 2 is high
if input longer than 30s
output on

else output of


int inputpin1 = 2;
int inputpin2 = 3;
int outputpin1 = 4;
int inputpin1Status = 0;
int inputpin2Status = 0;

void setup()
{
pinMode(outputpin1, OUTPUT);
pinMode(inputpin1, INPUT);
pinMode(inputpin2, INPUT);
}

void loop()
{
inputpin1Status = digitalRead(inputpin1);
inputpin2Status = digitalRead(inputpin2);

if (inputpin1Status == HIGH || inputpin2Status == HIGH )
{
digitalWrite(outputpin1, HIGH);
}
else
{
digitalWrite(outputpin1, LOW);
}
}

Capture the millis() value when each signal goes high to a variable unsigned long pin1HighStart
Only turn the output ON if inputpin1Status == HIGH && millis() - pin1HighStart >= 20000
Repeat the above with a separate capture variable for pin2

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
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.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Tom.... :slight_smile: