 
     // if this is first time button is pressed, move the setpoint
     // if both buttons are pressed, toggle system on and off and save to eeprom
-    // TODO: write this as an interrupt?
+    // write this as an interrupt someday?
     if ((stateUp == LOW) && (stateDwn == LOW) && (prevUp != LOW) && (prevDwn != LOW)) {
         if (mode == off) {
             mode = on;

    yellow wire - cooling
    white wire - heating
    */
    static unsigned long timeFan = 0;
    unsigned long timeCurrent = millis();

    switch(unit) {
        case cool:
            if ((timeCurrent - timeFan) < fanDelay) {
                driveUnit(fan);
            } else {
                if (digitalRead(relayAC) != HIGH) {
                    digitalWrite(relayAC, HIGH);
                }
            }
            break;
        case heat:
            if ((timeCurrent - timeFan) < fanDelay) {
                driveUnit(fan);
            } else {
                if (digitalRead(relayHeat) != HIGH) {
                    digitalWrite(relayHeat, HIGH);
                }
            }
            break;
        case fan:
            if (digitalRead(relayFan) != HIGH) {
                timeFan = timeCurrent;
                digitalWrite(relayFan, HIGH);
            }
            break;
        case shutdown:

        default:
            digitalWrite(relayFan, LOW);
            digitalWrite(relayAC, LOW);
            digitalWrite(relayHeat, LOW);
            break;
    }
}


int getEEPROMint(int address) {
    uint8_t hiByte, loByte;

    hiByte = EEPROM.read(address);
    loByte = EEPROM.read(address + 1);

    return word(hiByte, loByte);
}


void setEEPROMint(int address, int value) {
    uint8_t hiByte, loByte;

    hiByte = highByte(value);
    loByte = lowByte(value);

    if (EEPROM.read(address) != hiByte) {
        EEPROM.write(address, hiByte);
    }
    if (EEPROM.read(address + 1) != loByte) {
        EEPROM.write(address + 1, loByte);
    }
}


void setEEPROMbyte(int address, uint8_t value) {
    if (EEPROM.read(address) != value) {
        EEPROM.write(address, value);
    }

    Serial.print(F("   deg C: "));
    Serial.print(tempC);

    return int(tempF * 10.0);
}


