 
 // Prototypes for the commands.
 command(setPurge);
-command(setAutoPurge);
 
 // 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


  // and if the argument isn't 0 or 1, return an error.
  else Serial.println("ERROR: Purge valve state invalid (must be 0 or 1).");
}


command(setAutoPurge) {
  // A quick check that the number of arguments received is correct.
  // Does not include the command name in the number of arguments.
  if (numArgs() != 1) {
    Serial.println("ERROR: SetPurge expects 1 argument, received " + String(numArgs()) + ".");
    return;
  }
  
  // Create a place to put the argument into a real value.
  int AutoPurgeState = intArg(1);

  // Sets AutoPurgeFlag as true or false to determine whether to initialize AutoPurge sequence.
  if (AutoPurgeState == 0) {
    AutoPurgeFlag = false;
    Serial.println("AutoPurge is set to OFF.")
  }
  else if (AutoPurgeState == 1) {
    AutoPurgeFlag = true;
    Serial.println("AutoPurge is set to ON.")
  }
}
  // 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;
