A few minutes of analyzing the example was all I needed.
Here is my final working sketch for anyone else who may benefit in the future.
int input1 = 2; // input detection pin set to Digital pin 2
int relay1 = 7; // output 1 relay on digital Pin 7,6,5, etc
int relay2 = 6;
int GPIcounter = 0;
int GPIstate = 0 ;
int lastGPIstate = 0; // previous state of the button
void setup() {
pinMode(input1, INPUT); // initialize input 1 pin as INPUT
pinMode(relay1, OUTPUT); // initialize relay 2
pinMode(relay2, OUTPUT); // initialize relay 2
Serial.begin(9600);
}
void loop(){
GPIstate = digitalRead(input1);
// compare the buttonState to its previous state
if (GPIstate != lastGPIstate) {
// if the GPI state has changed, call function relayF1
if (GPIstate == HIGH) {
// if the current state is HIGH then the GPI state went from off to on:
relayF1();
} else {
relayF2();
}
// Delay a little bit to avoid bouncing
delay(50);
}
// save the current state as the last state, for next time through the loop
lastGPIstate = GPIstate;
}
void relayF1(){
digitalWrite(relay1, HIGH); //change Relay 1 Pin to HIGH
Serial.println("GPI Detected - Relay 1 Engage - Pause 2 Seconds"); //Print result
delay(2000); //wait 2 seconds
digitalWrite(relay1, LOW); //change Relay 1 Pin to LOW
Serial.println("Relay 1 Disengage"); //Print result
delay(500); //cleanup
}
void relayF2(){
digitalWrite(relay2, HIGH); //change Relay 2 Pin to HIGH
Serial.println("GPI Detected - Relay 2 Engage - Pause 2 Seconds"); //Print result
delay(2000); //wait 2 seconds
digitalWrite(relay2, LOW); //change Relay 2 Pin to LOW
Serial.println("Relay 2 Disengage"); //Print result
delay(500); //cleanup
}