 	digitalWrite(VALV_PUMP, LOW);
 	digitalWrite(VALV_ATM, HIGH);
 
-	ledStat.setPixelColor(0, ledStat.Color(0, 255,0));
-	ledStat.show();
-}
-
-
+	ledStat.setPixelColor(0, ledStat.Color(238, 130, 238));
+	ledStat.show();
+	stateStartTime = millis();	
+}
+
+
+void drainUpdate() {
+	if((millis() - stateStartTime) < drainTimeout) {
+		stateMachine.transitionTo(done_state);
+	}
+}
+
+void done() {
+	digitalWrite(PUMP, LOW);
+	digitalWrite(VALV_PUMP, LOW);
+	digitalWrite(VALV_ATM, LOW);
+
+	ledStat.setPixelColor(0, ledStat.Color(0, 255, 0));
+	ledStat.show();
+}
+

long debounceDelay = 100;    // the debounce time; increase if the output flickers

// Different states of the machine: Idle, Vacuum, Dwell, and Drain
enum states {IDLED, VACU, DRIN, DWLL};
const byte NUM_OF_STATES = 3; 	//	Number of total states
Adafruit_NeoPixel ledStat = Adafruit_NeoPixel(1, NEOPIX, NEO_GRB + NEO_KHZ800);		//	Neopixel initializiation

void setup() {


unsigned long stateStartTime;			//	Used to track times for entering Vacuum/Dwell states
unsigned long stateDebounceLimit = 30000;	//	Used to define state debounce time limit

unsigned long drainTimeout = 60000;		//	Timeout for Drain

int buttonState;             // the current reading from the input pin
int lastButtonState = HIGH;   // the previous reading from the input pin
