   mfrc522.PCD_Init(); // Init MFRC522 card
 
   //set digital signal pin for the door
-  pinMode(D2, OUTPUT);
+  pinMode(DoorRelay, OUTPUT);
 
   //ver1.7 buzzer
-  pinMode(D3, OUTPUT);
+  pinMode(Buzzer, OUTPUT);
   CloseDoor();
 
   Connect2Wifi();

}

void warnForNoAuthCard() {
        digitalWrite(D3,HIGH);
        delay (100);
        digitalWrite(D3,LOW);
        delay (100);
        digitalWrite(D3,HIGH);
        delay (100);
        digitalWrite(D3,LOW);
        delay (100);
        digitalWrite(D3,HIGH);
        delay (100);
        digitalWrite(D3,LOW);
        delay (100);
        digitalWrite(D3,HIGH);
        delay (300);
        digitalWrite(D3,LOW);  
}

void warnForNoWIFI() {
        digitalWrite(D3,HIGH);
        delay (2000);  
        digitalWrite(D3,LOW);
        delay (1000);
        digitalWrite(D3,HIGH);
        delay (2000);  
        digitalWrite(D3,LOW);
}

void warnForNoServer() {
        digitalWrite(D3,HIGH);
        delay (1000); 
        digitalWrite(D3,LOW);
        delay (200);  
        digitalWrite(D3,HIGH);
        delay (200);
        digitalWrite(D3,LOW);
        delay (1000); 
        digitalWrite(D3,HIGH);
        delay (1000); 
        digitalWrite(D3,LOW);
        delay (200);  
        digitalWrite(D3,HIGH);
        delay (200); 
        digitalWrite(D3,LOW);       
}

void OpenDoor()
{
  digitalWrite(D3,HIGH);  
  digitalWrite(D2, LOW);
  delay (350);
  digitalWrite(D3,LOW);
  
}

void CloseDoor()
{
  digitalWrite(D2, HIGH);
}

void Connect2Wifi()

#define SS_PIN  15  // SDA-PIN for RC522 - RFID - SPI - Module GPIO-15
#define DEBUGMODE 0

#define DoorRelay D2
#define Buzzer D3

const char* ssid = "XinCheJian";  //the wifi network ssid
const char* password = "imakestuff";  //password to ssid
const char* host = "192.168.1.100";   //server ip address
