 #define LED_PIN            D7
 
 #define SENSOR_CHECK_MS    2000
-#define SENSOR_REPORT_MS   30000
+
+#define EEPROM_PROGRAM_KEY 0xA5A5A5A5
+#define EEPROM_REPORT_MS   60000
+
+struct settingsEEPROM {
+    unsigned int programmedKey;
+    unsigned int sensorReportMillis;
+};
+
+union {
+    settingsEEPROM settings;
+    char raw[sizeof(settingsEEPROM)];
+} EEPROM_Data;
 
 double currentTempF = 0.0;
 double currentHumid = 0.0;

    }
}

void doReportIfTime() {
    static bool firstTime = true;
    static unsigned long lastReportMillis = 0;
    unsigned long now = millis();
    char publishString[64];

    if (firstTime || ((now - lastReportMillis) >= SENSOR_REPORT_MS)) {
        SERIAL.println("Reporting sensor data to server");
        
        snprintf(publishString, sizeof(publishString), "{\"tempF\": %.1f, \"humid\": %.1f}", currentTempF, currentHumid);


DHT dht(DHT_PIN, DHT_TYPE);

static void readEEPROM(void) {
    unsigned int i;
    for (i = 0; i < sizeof(settingsEEPROM); ++i) {
        EEPROM_Data.raw[i] = EEPROM.read(i);
    }
    SERIAL.print(i);
    SERIAL.println(" bytes read from EEPROM");
}

static void writeEEPROM(void) {
    unsigned int i;
    for (i = 0; i < sizeof(settingsEEPROM); ++i) {
        EEPROM.write(i, EEPROM_Data.raw[i]);
    }
    SERIAL.print(i);
    SERIAL.println(" bytes wrote to EEPROM");
}

static void buttonPress(void) {
    buttonPressMillis = millis();
    buttonReleaseMillis = 0;
}

static void checkStateChange(void) {
    if (buttonPressMillis > 0) {
        if (digitalRead(BUTTON_PIN) == HIGH) {
            // False button press, ignore.
