   digitalWrite(sensorPin, HIGH); //Sets the pullup resistor
 
   //Speaker is already set up by default as output
+  
+  //Read in mode from EEPROM
+  int storedMode = EEPROM.read(eepromModeAddress);
+  if (storedMode == 0) {
+    opMode = sensor;
+    blinkRate = sensorBlinkRate;
+  }
+  else if (storedMode == 1) {
+    opMode = alarm;
+    blinkRate = alarmBlinkRate;
+  }
 
   //Setup Bluetooth/serial
   //Even though they might not be used (based on mode), activate them anyways so that the

    else if (input == '0' && counter == 1) {
      opMode = sensor;
      blinkRate = sensorBlinkRate;
      retVal = true;
      Serial.print("Now a sensor. Reconfiguration successful");
    }
    else if (input == '1' && counter == 1) {
      opMode = alarm;
      blinkRate = alarmBlinkRate;
      retVal = true;
      Serial.print("Now an alarm. Reconfiguration successful.");
    }
    else if (input == '2' && counter == 1) {
      

 */

#include <SoftwareSerial.h>
#include <EEPROM.h>

//General-use global variables
enum mode {sensor, alarm};
unsigned long time = millis();
const unsigned int eepromModeAddress = 0;
mode opMode = sensor;
bool reconfiguration();

