 String serial_buffer = "";
 String serial_unfinished_line = "";
 String buffer = "";
+
+int Epin = A7;
 
 void updateDisplay() {
   lcd.clear();

  resetTimeout();
}

void setup() {
  lcd.begin(16, 2);
  lcd.print("Booting....");
  
  Serial.begin(9600);		// Initialize serial communications with the PC
  
  SPI.begin();			// Init SPI bus
  mfrc522.PCD_Init();		// Init MFRC522
  
  updateDisplay();
}

void loop() {
  if (Serial.available() > 0) {

      setState(LOCKED);
    }
  } else if (state == UNLOCKED) {
    if ( checkE() ) {
      callRing();
    }
    
    char key = keypad.getKey();
    
    if (key) {
      if (key == 'P' || key == 'E') {
        if (buffer == "0") {
          Serial.println("LOCK;");
          setState(LOCKED);
