int triggerInput = 12;
int relayOutput = 8;
unsigned long timerCount = 0;
void setup()
{
pinMode (triggerInput, INPUT_PULLUP);
pinMode(relayOutput, OUTPUT);
digitalWrite(relayOutput, LOW);
}
void loop()
{
if (digitalRead (triggerInput) == LOW)
{
timerCount = 1 * 60 * 10; //~ 1 min
//(X mins * XX sec * XX * 1 deciseconds)
}
if (timerCount != 0)
{
digitalWrite(relayOutput, HIGH);
timerCount = timerCount - 1;
delay(100);
}
else {
digitalWrite(relayOutput, LOW);
}
}