   byte buffer[EF_ID_SERVIZI_LENGTH];
   if (!cie.read_EF_ID_Servizi(buffer, &bufferLength)) {
     Serial.print(F("Error reading EF.ID_SERVIZI"));
-    delay(1000);
+    blinkRedLed();
+    delay(100);
     return;
   }
   Serial.print(F("EF.ID_Servizi: "));
   cie.printHex(buffer, bufferLength);
 
+  turnGreenLedOn();
+  openTurnstile();
   printHi();
   count++;
   delay(1000);
   clearMatrix();
   delay(200);
   printId(buffer);
-  delay(200);
+  delay(2000);
+  turnGreenLedOff();
+  closeTurnstile();
   printCount();
+  
 
 
   Serial.println();

   delay(100);
 }
 delay(100);
}
  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..."));
}

