 
 // Create a Flag to tell the main loop when the StartPin interrupt has been triggered.
 boolean StartPinFlag = false;
-
-// Create a Flag to tell if AutoPurge is on.
-boolean AutoPurgeFlag = false;
 
 // Sets the trigger edge for the StartPin signal. 0 is falling, 1 is rising. I am making it
 // an int instead of a define so that you can for instance have a command that changes which

    // which assumes a globally defined elapsedMillis named elapsed, or
    // setting some pin:
    digitalWrite(TriggeredPin, HIGH);

    // If AutoPurge is on and GC signal sends an interrupt, start the AutoPurge sequence.
    if (AutoPurgeFlag) {
      // Utilize evaluateCommand("setPurge 1")????
      digitalWrite(PurgePin, HIGH);
      Serial.println("Purge valve set to ON.");
    }
  }

  // This example shows a way to used the elapsed time to set the TriggeredPin low after TriggeredPinDelay (ms).
  if (elapsed > TriggeredPinDelay) {
    digitalWrite(TriggeredPin, LOW);
    if (digitalRead(PurgePin) == HIGH) {
      digitalWrite(PurgePin, LOW);
      Serial.println("Purge valve set to OFF.")
    }
    elapsed =- TriggeredPinDelay;
  }


  // Register the commands created to attach running the function with receiving a starting string over USB Serial.
  // Third argument is a description to be displayed when you send the command ListCommands.
  registerCommand("SetPurge", setPurge, "Set Purge Valve State (0/1)");
}

elapsedMillis elapsed;
