   matrix.begin(0x70);
   count = 0;
   clearMatrix();
+
+  pinMode(GREEN_LED, OUTPUT);
+  pinMode(RED_LED, OUTPUT);
+
+  digitalWrite(RED_LED, LOW);
+  digitalWrite(GREEN_LED, LOW);
+
+  servo.attach(SERVO); 
+
   Serial.println(F("PN532 initialized, waiting for a CIE card..."));
 }
 

#define PN532_SS   (4)
#define PN532_MISO (5)

// I2C is not supported in this release
//#define PN532_IRQ   (2)
//#define PN532_RESET (3)  // Not connected by default on the NFC Shield

   delay(100);
 }
 delay(100);
}

void blinkRedLed() {
  digitalWrite(RED_LED, HIGH);
  delay(200);
  digitalWrite(RED_LED, LOW);
  delay(200);
  digitalWrite(RED_LED, HIGH);
  delay(200);
  digitalWrite(RED_LED, LOW);
}

void turnGreenLedOn() {
  digitalWrite(GREEN_LED, HIGH);
}

void turnGreenLedOff() {
  digitalWrite(GREEN_LED, LOW);
}

void openTurnstile() {
  for(byte angle = 90; angle > 0; angle--)    
  {                                
    servo.write(angle);           
    delay(5);       
  } 

}

void closeTurnstile() {
  for(byte angle = 0; angle < 90; angle++)  
  {                                  
    servo.write(angle);               
    delay(5);                   
  }  
}