Reducir variables globales

Buena tarde a todos, soy principiante y tengo un problema en mi sketch para control de acceso me gustaria que me hecharan la mano donde puedo reducir

#include <SPI.h>
#include <MFRC522.h>
#include <Wire.h>//Libreria para bus I2C
#include <LiquidCrystal_I2C.h>//Libreria para pantalla LCD I2C
 
#define SS_PIN 10
#define RST_PIN 9
#define Buzzer 7  // Pin del Buzzer
#define RELAY 6 // Pin del Relay
LiquidCrystal_I2C lcd(0x27,16,2);//crea una instancia de pantalla I2C
MFRC522 mfrc522(SS_PIN, RST_PIN);   // Crea la instancia MFRC522
 
void setup() 
{
  Serial.begin(9600);   // Inicializa la comunicacion serial
  SPI.begin();          // Inicializa el bus SPI
  mfrc522.PCD_Init();   // Inicializa el MFRC522
  pinMode(Buzzer, OUTPUT);
  pinMode(RELAY, OUTPUT);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,HIGH);
  lcd.init();//Inicializa la pantalla
  lcd.backlight();//Enciende la luz de fondo
  lcd.setCursor(0,0);
  lcd.print("  Iniciando...");//Escribe el mensaje
  lcd.setCursor(0,1);//Ir a la segunda fila
  lcd.print("Sotun  V4.280422");//Escribe el mensaje

}

void loop() 
{
  // Mirando para nuevas tarjeras
  if ( ! mfrc522.PICC_IsNewCardPresent()) 
  {
    return;
  }
  // Selecciona una de las tarjetas
  if ( ! mfrc522.PICC_ReadCardSerial()) 
  {
    return;
  }
  // Muestra el UID sobre el Monitor Serial
  String content= "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++) 
  {
    content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
    content.concat(String(mfrc522.uid.uidByte[i], HEX));
  }
  Serial.println();
  content.toUpperCase();

 // Tarjetas Autorizadas
 
if (content.substring(1) =="AA 01 B7 5C") //Casa 01A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="5A E7 B8 5C") //Casa 01A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="33 C0 53 97") //Casa 01B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="B6 3D 91 5D") //Casa 02A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 F4 84 9A DF 49 80") //Casa 02B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 52 C0 9A DF 49 81") //Casa 02B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="39 CA D3 B8") //Casa 02B-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="B9 F9 CF B8") //Casa 02B-04
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="56 1C 8C 5D") //Casa 03A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="96 8E 93 5D") //Casa 03A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="36 3D 8E 5D") //Casa 03B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="96 71 8F 5D") //Casa 04AB-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="3A A0 E7 80") //Casa 04AB-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="0A FB CF 80") //Casa 04AB-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="9A 87 C9 5C") //Casa 04AB-04
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="A9 48 FA B9") //Casa 05A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="19 A3 CC B8") //Casa 05A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="03 8F 2B 97") //Casa 05B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 10 D7 82 AD 5E 81") //Casa 06A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 C3 F1 82 AD 5E 80") //Casa 06A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="66 94 93 5D") //Casa 06A-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="76 CE 57 3A") //Casa 06B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 3C 9C 82 AD 5E 80") //Casa 06B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="A6 9B 94 5D") //Casa 07A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="3A 53 BD 5C") //Casa 07A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="D6 B3 92 5D") //Casa 07A-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 EF 9C 82 30 4C 80") //Casa 07B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="B6 6F 58 3A") //Casa 07B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="2C 0A 2A 49") //Casa 07B-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="9C DD 58 49") //Casa 07B-04
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="CC 87 C5 38") //Casa 07B-05
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 51 DF 82 30 4C 81") //Casa 07B-06
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 6C 3F 82 AD 5E 81") //Casa 08A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="46 B0 95 5D") //Casa 08B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="EA 65 04 5D") //Casa 08B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="FA A7 EF 5B") //Casa 08B-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="73 1C 38 97") //Casa 09A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="16 C8 51 3A") //Casa 09B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="36 D8 90 5D") //Casa 09B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 42 6E 82 30 4C 80") //Casa 09B-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="2A CF E4 80") //Casa 09B-04
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="BA 49 EE 81") //Casa 09B-05
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="1A 48 F4 80") //Casa 09B-06
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="76 1F 8E 5D") //Casa 10A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="16 33 90 5D") //Casa 10A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="B6 B3 96 5D") //Casa 10A-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="56 C1 92 5D") //Casa 10B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="06 7A 8B 5D") //Casa 10B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="66 AB 90 5D") //Casa 10B-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="76 6C 58 3A") //Casa 11A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="16 9D 8F 5D") //Casa 11B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="E6 C0 90 5D") //Casa 11B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="96 14 56 3A") //Casa 12A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="3C A1 1E 49") //Casa 12A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="A7 74 79 4B") //Casa 12A-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="D9 DE D1 B8") //Casa 12B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="2A 50 EB 5B") //Casa 12B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="46 56 51 3A") //Casa 13A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="16 EB 8F 5D") //Casa 13A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="BA 2B 99 15") //Casa 13A-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="86 AE 55 3A") //Casa 13B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="36 E4 95 5D") //Casa 13B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="96 73 96 5D") //Casa 14A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="6A 37 C7 5C") //Casa 14A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="4A 12 03 5D") //Casa 14B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="83 45 FE 96") //Casa 14B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="DA 45 BA 5C") //Casa 15A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="AA 7D EE 5B") //Casa 15A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="CA F6 DC 5C") //Casa 15B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="96 DA 8B 5D") //Casa 15B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="XX XX XX XX") //Casa 16A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="16 2E 8B 5D") //Casa 16B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="86 AB 50 3A") //Casa 16B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="26 D7 91 5D") //Casa 16B-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="36 75 91 5D") //Casa 16B-04
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="36 17 58 3A") //Casa 17A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="B6 60 92 5D") //Casa 17A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="AA 74 E6 5B") //Casa 17A-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="2A ED D6 5C") //Casa 17A-04
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 AB C7 82 30 4C 80") //Casa 17B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="C6 BC 92 5D") //Casa 18A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="86 5E 8C 5D") //Casa 18A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="3A 98 EC 5B") //Casa 18A-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="06 FE 8B 5D") //Casa 18B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="76 45 8F 5D") //Casa 18B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="AA 57 33 15") //Casa 19A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="49 11 58 59") //Casa 19A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="D4 C9 6B B8") //Casa 19A-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="0D 55 FC FB") //Casa 19A-04
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="DE D3 19 22") //Casa 19A-05
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="23 5D 59 97") //Casa 19A-06
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 5D 53 82 30 4C 80") //Casa 19B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="16 E7 8F 5D") //Casa 19B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="A6 CA 95 5D") //Casa 20A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 DD 4F 82 AD 5E 80") //Casa 20A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="AA 7C 0A 5C") //Casa 20A-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="0C 56 DF 38") //Casa 20A-04
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="1A 10 E1 5C") //Casa 20A-05
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="76 50 95 5D") //Casa 20B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 80 70 82 AD 5E 81") //Casa 20B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 37 5B 82 AD 5E 81") //Casa 20B-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="AA B8 37 16") //Casa 21AB-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 87 72 82 AD 5E 80") //Casa 21AB-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 30 9C 9A DF 49 81") //Casa 21AB-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="56 37 92 5D") //Casa 21AB-04
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="86 00 8E 5D") //Casa 22A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="A6 9A 96 5D") //Casa 22A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="04 C5 3C 82 AD 5E") //Casa 22A-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="F6 E0 8B 5D") //Casa 22A-04
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="C6 BE 8C 5D") //Casa 22A-05
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="AA F2 C9 5B") //Casa 22A-06
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="03 36 3D 97") //Casa 22B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="73 B2 3B 97") //Casa 22B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="53 76 15 97") //Casa 22B-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="26 52 92 5D") //Casa 23A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="23 88 23 97") //Casa 23A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="86 7F 50 3A") //Casa 23B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="F6 1C 55 3A") //Casa 23B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="83 97 43 97") //Casa 24A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="29 C5 CC B8") //Casa 24B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="BA 58 F8 5C") //Casa 24B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="CA 66 B8 5C") //Casa 24B-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="9A 79 D8 5C") //Casa 24B-04
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="8A 59 B3 5C") //Casa 26A-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="2a 94 ff 5c") //Casa 26A-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="4c 6b 26 4a") //Casa 26A-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="F6 69 8D 5D") //Casa 26B-01
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="36 97 8F 5D") //Casa 26B-02
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="B6 90 8B 5D") //Casa 26B-03
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="26 15 52 3A") //Casa 26B-04
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="2C 1B 2D 49") //Casa 26B-05
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
else if (content.substring(1) =="4C 14 39 49") //Casa 26B-06
  {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
  }
  
  else
   {
   
  }

  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print(" Acerque Tag...");
  lcd.setCursor(0,1);
  lcd.print(" Priv  Geranios");
  
}

Su publicacion se MUEVE a su ubicacion actual ya que es mas adecuada.

Moderador:
Por favor, lee las Normas del foro y edita tu código/error usando etiquetas de código.
Ve a edición, luego selecciona todo el código que has publicado, lo cortas y click en </>


En este foro no se permiten capturas de códigos, debes postear todo el código como te he indicado.
Ademas, tu hilo ha sido movido del foro en inglés porque si posteas en el foro en inglés usa idioma inglés para expresarte.
Si escribes en español debes usar el foro Arduino en español.

Leete esta PAGINA y sabras que hacer con el trozo de codigo:

 lcd.setCursor(0, 0);
  lcd.println(F(" Bienvenido "));
  digitalWrite(Buzzer, HIGH);
  delay(500);
  digitalWrite(Buzzer, LOW);
  digitalWrite(RELAY, LOW);
  delay(250);
  digitalWrite(RELAY, HIGH);
  lcd.clear();

que tanto repites. No creo que se pueda simplificar mucho mas.

No puedo probarlo pero si funciona creo que esta mas simple no?

#include <SPI.h>
#include <MFRC522.h>
#include <Wire.h>//Libreria para bus I2C
#include <LiquidCrystal_I2C.h>//Libreria para pantalla LCD I2C
 
#define SS_PIN 10
#define RST_PIN 9
#define Buzzer 7  // Pin del Buzzer
#define RELAY 6 // Pin del Relay
LiquidCrystal_I2C lcd(0x27,16,2);//crea una instancia de pantalla I2C
MFRC522 mfrc522(SS_PIN, RST_PIN);   // Crea la instancia MFRC522


#define ARRAY_SIZE(x) sizeof(x)/sizeof(x[0])

String[] autorizadas   {"AA 01 B7 5C", "5A E7 B8 5C", "33 C0 53 97", "B6 3D 91 5D", "04 F4 84 9A DF 49 80", "04 52 C0 9A DF 49 81", "39 CA D3 B8", "B9 F9 CF B8", "56 1C 8C 5D",
						"96 8E 93 5D", "36 3D 8E 5D", "96 71 8F 5D", "3A A0 E7 80", "0A FB CF 80", "9A 87 C9 5C", "A9 48 FA B9", "19 A3 CC B8", "03 8F 2B 97", "04 10 D7 82 AD 5E 81",
						"04 C3 F1 82 AD 5E 80", "66 94 93 5D", "76 CE 57 3A", "04 3C 9C 82 AD 5E 80", "A6 9B 94 5D", "3A 53 BD 5C", "D6 B3 92 5D", "04 EF 9C 82 30 4C 80", "B6 6F 58 3A",
						"2C 0A 2A 49", "9C DD 58 49", "CC 87 C5 38", "04 51 DF 82 30 4C 81", "04 6C 3F 82 AD 5E 81", "46 B0 95 5D", "EA 65 04 5D", "FA A7 EF 5B", "73 1C 38 97", "16 C8 51 3A"
						"36 D8 90 5D", "04 42 6E 82 30 4C 80", "2A CF E4 80", "BA 49 EE 81", "1A 48 F4 80", "76 1F 8E 5D", "16 33 90 5D", "B6 B3 96 5D", "56 C1 92 5D", "06 7A 8B 5D",
						"66 AB 90 5D", "76 6C 58 3A", "16 9D 8F 5D", "E6 C0 90 5D", "96 14 56 3A", "3C A1 1E 49", "A7 74 79 4B", "D9 DE D1 B8", "2A 50 EB 5B", "46 56 51 3A", "16 EB 8F 5D",
						"BA 2B 99 15", "86 AE 55 3A", "36 E4 95 5D", "96 73 96 5D", "6A 37 C7 5C", "4A 12 03 5D", "83 45 FE 96", "DA 45 BA 5C", "AA 7D EE 5B", "CA F6 DC 5C", "96 DA 8B 5D",
						"XX XX XX XX", "16 2E 8B 5D", "86 AB 50 3A", "26 D7 91 5D", "36 75 91 5D", "36 17 58 3A", "B6 60 92 5D", "AA 74 E6 5B", "2A ED D6 5C", "04 AB C7 82 30 4C 80", 
						"C6 BC 92 5D", "86 5E 8C 5D", "3A 98 EC 5B", "06 FE 8B 5D", "76 45 8F 5D", "AA 57 33 15", "49 11 58 59", "D4 C9 6B B8", "0D 55 FC FB", "DE D3 19 22", "23 5D 59 97", 
						"04 5D 53 82 30 4C 80", "16 E7 8F 5D", "A6 CA 95 5D", "04 DD 4F 82 AD 5E 80", "AA 7C 0A 5C", "0C 56 DF 38", "1A 10 E1 5C", "76 50 95 5D", "04 80 70 82 AD 5E 81", 
						"04 37 5B 82 AD 5E 81", "AA B8 37 16", "04 87 72 82 AD 5E 80", "04 30 9C 9A DF 49 81", "56 37 92 5D", "86 00 8E 5D", "A6 9A 96 5D", "04 C5 3C 82 AD 5E", 
						"F6 E0 8B 5D", "C6 BE 8C 5D", "AA F2 C9 5B", "03 36 3D 97", "73 B2 3B 97", "53 76 15 97", "26 52 92 5D", "23 88 23 97", "86 7F 50 3A", "F6 1C 55 3A", "83 97 43 97", 
						"29 C5 CC B8", "BA 58 F8 5C", "CA 66 B8 5C", "9A 79 D8 5C", "8A 59 B3 5C", "2a 94 ff 5c", "4c 6b 26 4a", "F6 69 8D 5D", "36 97 8F 5D", "B6 90 8B 5D", "26 15 52 3A", 
						"2C 1B 2D 49", "4C 14 39 49"}; 
void accion() {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
} 
 
void setup() 
{
  Serial.begin(9600);   // Inicializa la comunicacion serial
  SPI.begin();          // Inicializa el bus SPI
  mfrc522.PCD_Init();   // Inicializa el MFRC522
  pinMode(Buzzer, OUTPUT);
  pinMode(RELAY, OUTPUT);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,HIGH);
  lcd.init();//Inicializa la pantalla
  lcd.backlight();//Enciende la luz de fondo
  lcd.setCursor(0,0);
  lcd.print("  Iniciando...");//Escribe el mensaje
  lcd.setCursor(0,1);//Ir a la segunda fila
  lcd.print("Sotun  V4.280422");//Escribe el mensaje

}

void loop() 
{
  // Mirando para nuevas tarjeras
  if ( ! mfrc522.PICC_IsNewCardPresent()) 
  {
    return;
  }
  // Selecciona una de las tarjetas
  if ( ! mfrc522.PICC_ReadCardSerial()) 
  {
    return;
  }
  // Muestra el UID sobre el Monitor Serial
  String content= "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++) 
  {
    content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
    content.concat(String(mfrc522.uid.uidByte[i], HEX));
  }
  Serial.println();
  content.toUpperCase();

 // Tarjetas Autorizadas
  for (size_t i = 0; i < ARRAY_SIZE(autorizadas); i++) {
	   if (content.substring(1) == autorizadas[i])
		   accion();
  }

  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print(" Acerque Tag...");
  lcd.setCursor(0,1);
  lcd.print(" Priv  Geranios");
  
}

No lo he probado.

1 Like

Si es mucho mas simple pero me lanza el error (decomposition declaration cannot be declared with type 'String')

Ya funciona con un cambio que hice pero al poner todos los tags la memoria dinamica se pasa al 150%

Bueno, habra que ponerlo en PROGMEM o sea en la flash.
Me ha costado porque no se pueden guardar los String en PROGMEM o sea en las Flash.
Asi que he hecho esto mirando por acá y por allá.
Funciona porque lo probé a nivel del almacenamiento nada mas.

#include <SPI.h>
#include <MFRC522.h>
#include <Wire.h>//Libreria para bus I2C
#include <LiquidCrystal_I2C.h>//Libreria para pantalla LCD I2C
 
#define SS_PIN 10
#define RST_PIN 9
#define Buzzer  7   // Pin del Buzzer
#define RELAY   6   // Pin del Relay
LiquidCrystal_I2C lcd(0x27,16,2);//crea una instancia de pantalla I2C
MFRC522 mfrc522(SS_PIN, RST_PIN);   // Crea la instancia MFRC522


#define ARRAY_SIZE(x) sizeof(x)/sizeof(x[0])

const char name0[] PROGMEM = "AA 01 B7 5C";
const char name1[] PROGMEM = "5A E7 B8 5C";
const char name2[] PROGMEM = "33 C0 53 97";
const char name3[] PROGMEM = "B6 3D 91 5D";
const char name4[] PROGMEM = "04 F4 84 9A DF 49 80";
const char name5[] PROGMEM = "04 52 C0 9A DF 49 81";
const char name6[] PROGMEM = "39 CA D3 B8";
const char name7[] PROGMEM = "B9 F9 CF B8";
const char name8[] PROGMEM = "56 1C 8C 5D";
const char name9[] PROGMEM = "96 8E 93 5D";
const char name10[] PROGMEM = "36 3D 8E 5D";
const char name11[] PROGMEM = "96 71 8F 5D";
const char name12[] PROGMEM = "3A A0 E7 80";
const char name13[] PROGMEM = "0A FB CF 80";
const char name14[] PROGMEM = "9A 87 C9 5C";
const char name15[] PROGMEM = "A9 48 FA B9";
const char name16[] PROGMEM = "19 A3 CC B8";
const char name17[] PROGMEM = "03 8F 2B 97";
const char name18[] PROGMEM = "04 10 D7 82 AD 5E 81";
const char name19[] PROGMEM = "04 C3 F1 82 AD 5E 80";
const char name20[] PROGMEM = "66 94 93 5D";
const char name21[] PROGMEM = "76 CE 57 3A";
const char name22[] PROGMEM = "04 3C 9C 82 AD 5E 80";
const char name23[] PROGMEM = "A6 9B 94 5D";
const char name24[] PROGMEM = "3A 53 BD 5C";
const char name25[] PROGMEM = "D6 B3 92 5D";
const char name26[] PROGMEM = "04 EF 9C 82 30 4C 80";
const char name27[] PROGMEM = "B6 6F 58 3A";
const char name28[] PROGMEM = "2C 0A 2A 49";
const char name29[] PROGMEM = "9C DD 58 49";
const char name30[] PROGMEM = "cC 87 C5 38";
const char name31[] PROGMEM = "04 51 DF 82 30 4C 81";
const char name32[] PROGMEM = "04 6C 3F 82 AD 5E 81";
const char name33[] PROGMEM = "46 B0 95 5D";
const char name34[] PROGMEM = "EA 65 04 5D";
const char name35[] PROGMEM = "FA A7 EF 5B";
const char name36[] PROGMEM = "73 1C 38 97";
const char name37[] PROGMEM = "16 C8 51 3A";
const char name38[] PROGMEM = "36 D8 90 5D";
const char name39[] PROGMEM = "04 42 6E 82 30 4C 80";
const char name40[] PROGMEM = "2A CF E4 80";
const char name41[] PROGMEM = "BA 49 EE 81";
const char name42[] PROGMEM = "1A 48 F4 80";
const char name43[] PROGMEM = "76 1F 8E 5D";
const char name44[] PROGMEM = "16 33 90 5D";
const char name45[] PROGMEM = "B6 B3 96 5D";
const char name46[] PROGMEM = "56 C1 92 5D";
const char name47[] PROGMEM = "06 7A 8B 5D";
const char name48[] PROGMEM = "66 AB 90 5D";
const char name49[] PROGMEM = "76 6C 58 3A";
const char name50[] PROGMEM = "16 9D 8F 5D";
const char name51[] PROGMEM = "E6 C0 90 5D";
const char name52[] PROGMEM = "96 14 56 3A";
const char name53[] PROGMEM = "3C A1 1E 49";
const char name54[] PROGMEM = "A7 74 79 4B";
const char name55[] PROGMEM = "D9 DE D1 B8";
const char name56[] PROGMEM = "2A 50 EB 5B";
const char name57[] PROGMEM = "46 56 51 3A";
const char name58[] PROGMEM = "16 EB 8F 5D";
const char name59[] PROGMEM = "BA 2B 99 15";
const char name60[] PROGMEM = "86 AE 55 3A";
const char name61[] PROGMEM = "36 E4 95 5D";
const char name62[] PROGMEM = "96 73 96 5D";
const char name63[] PROGMEM = "6A 37 C7 5C";
const char name64[] PROGMEM = "4A 12 03 5D";
const char name65[] PROGMEM = "83 45 FE 96";
const char name66[] PROGMEM = "DA 45 BA 5C";
const char name67[] PROGMEM = "AA 7D EE 5B";
const char name68[] PROGMEM = "cA F6 DC 5C";
const char name69[] PROGMEM = "96 DA 8B 5D";
const char name70[] PROGMEM = "XX XX XX XX";
const char name71[] PROGMEM = "16 2E 8B 5D";
const char name72[] PROGMEM = "86 AB 50 3A";
const char name73[] PROGMEM = "26 D7 91 5D";
const char name74[] PROGMEM = "36 75 91 5D";
const char name75[] PROGMEM = "36 17 58 3A";
const char name76[] PROGMEM = "B6 60 92 5D";
const char name77[] PROGMEM = "AA 74 E6 5B";
const char name78[] PROGMEM = "2A ED D6 5C";
const char name79[] PROGMEM = "04 AB C7 82 30 4C 80";
const char name80[] PROGMEM = "c6 BC 92 5D";
const char name81[] PROGMEM = "86 5E 8C 5D";
const char name82[] PROGMEM = "3A 98 EC 5B";
const char name83[] PROGMEM = "06 FE 8B 5D";
const char name84[] PROGMEM = "76 45 8F 5D";
const char name85[] PROGMEM = "AA 57 33 15";
const char name86[] PROGMEM = "49 11 58 59";
const char name87[] PROGMEM = "D4 C9 6B B8";
const char name88[] PROGMEM = "0D 55 FC FB";
const char name89[] PROGMEM = "DE D3 19 22";
const char name90[] PROGMEM = "23 5D 59 97";
const char name91[] PROGMEM = "04 5D 53 82 30 4C 80";
const char name92[] PROGMEM = "16 E7 8F 5D";
const char name93[] PROGMEM = "A6 CA 95 5D";
const char name94[] PROGMEM = "04 DD 4F 82 AD 5E 80";
const char name95[] PROGMEM = "AA 7C 0A 5C";
const char name96[] PROGMEM = "0C 56 DF 38";
const char name97[] PROGMEM = "1A 10 E1 5C";
const char name98[] PROGMEM = "76 50 95 5D";
const char name99[] PROGMEM = "04 80 70 82 AD 5E 81";
const char name100[] PROGMEM = "04 37 5B 82 AD 5E 81";
const char name101[] PROGMEM = "AA B8 37 16";
const char name102[] PROGMEM = "04 87 72 82 AD 5E 80";
const char name103[] PROGMEM = "04 30 9C 9A DF 49 81";
const char name104[] PROGMEM = "56 37 92 5D";
const char name105[] PROGMEM = "86 00 8E 5D";
const char name106[] PROGMEM = "A6 9A 96 5D";
const char name107[] PROGMEM = "04 C5 3C 82 AD 5E";
const char name108[] PROGMEM = "F6 E0 8B 5D";
const char name109[] PROGMEM = "c6 BE 8C 5D";
const char name110[] PROGMEM = "AA F2 C9 5B";
const char name111[] PROGMEM = "03 36 3D 97";
const char name112[] PROGMEM = "73 B2 3B 97";
const char name113[] PROGMEM = "53 76 15 97";
const char name114[] PROGMEM = "26 52 92 5D";
const char name115[] PROGMEM = "23 88 23 97";
const char name116[] PROGMEM = "86 7F 50 3A";
const char name117[] PROGMEM = "F6 1C 55 3A";
const char name118[] PROGMEM = "83 97 43 97";
const char name119[] PROGMEM = "29 C5 CC B8";
const char name120[] PROGMEM = "BA 58 F8 5C";
const char name121[] PROGMEM = "cA 66 B8 5C";
const char name122[] PROGMEM = "9A 79 D8 5C";
const char name123[] PROGMEM = "8A 59 B3 5C";
const char name124[] PROGMEM = "2a 94 ff 5c";
const char name125[] PROGMEM = "4c 6b 26 4a";
const char name126[] PROGMEM = "F6 69 8D 5D";
const char name127[] PROGMEM = "36 97 8F 5D";
const char name128[] PROGMEM = "B6 90 8B 5D";
const char name129[] PROGMEM = "26 15 52 3A";
const char name130[] PROGMEM = "2C 1B 2D 49";
const char name131[] PROGMEM = "4C 14 39 49";
const char * const Names[] PROGMEM = {name0 ,  name1,   name2,  name3,  name4,  name5,  name6,  name7,  name8,  name9,
                                      name10,  name11, name12, name13, name14, name15, name16, name17, name18, name19,
                                      name20,  name21, name22, name23, name24, name25, name26, name27, name28, name29,
                                      name30,  name31, name32, name33, name34, name35, name36, name37, name38, name39,
                                      name40,  name41, name42, name43, name44, name45, name46, name47, name48, name49,
                                      name50,  name51, name52, name53, name54, name55, name56, name57, name58, name59,
                                      name60,  name61, name62, name63, name64, name65, name66, name67, name68, name69,
                                      name70,  name71, name72, name73, name74, name75, name76, name77, name78, name79,
                                      name80,  name81, name82, name83, name84, name85, name86, name87, name88, name89,
                                      name90,  name91, name92, name93, name94, name95, name96, name97, name98, name99,
                                      name100,name101,name102,name103,name104,name105,name106,name107,name108,name109,
                                      name110,name111,name112,name113,name114,name115,name116,name117,name118,name119,
                                      name120,name121,name122,name123,name124,name125,name126,name127,name128,name129,
                                      name130,name131};

void accion() {
  lcd.setCursor(0,0);
  lcd.println(F("   Bienvenido   "));
  digitalWrite(Buzzer,HIGH);
  delay(500);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,LOW);
  delay(250);
  digitalWrite(RELAY,HIGH);
  lcd.clear();
} 
 
void setup() 
{
  Serial.begin(9600);   // Inicializa la comunicacion serial
  SPI.begin();          // Inicializa el bus SPI
  mfrc522.PCD_Init();   // Inicializa el MFRC522
  pinMode(Buzzer, OUTPUT);
  pinMode(RELAY, OUTPUT);
  digitalWrite(Buzzer,LOW);
  digitalWrite(RELAY,HIGH);
  lcd.init();//Inicializa la pantalla
  lcd.backlight();//Enciende la luz de fondo
  lcd.setCursor(0,0);
  lcd.print("  Iniciando...");//Escribe el mensaje
  lcd.setCursor(0,1);//Ir a la segunda fila
  lcd.print("Sotun  V4.280422");//Escribe el mensaje

}

void loop() 
{
  // Mirando para nuevas tarjeras
  if ( ! mfrc522.PICC_IsNewCardPresent()) 
  {
    return;
  }
  // Selecciona una de las tarjetas
  if ( ! mfrc522.PICC_ReadCardSerial()) 
  {
    return;
  }
  // Muestra el UID sobre el Monitor Serial
  String content= "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++) 
  {
    content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
    content.concat(String(mfrc522.uid.uidByte[i], HEX));
  }
  Serial.println();
  content.toUpperCase();

  // Tarjetas Autorizadas
  for (byte i = 0; i < (sizeof(Names) / sizeof(Names[0])); i++) {
    //Names[i] contains a pointer to a char array
    //&Names[i] references the actual char array 
    //pgm_read_word retrieves the pointer to the char array from PROGMEM
    //__FlashStringHelper * informs the compiler that the pointer references a char array that is stored in PROGMEM
    //Serial.println((__FlashStringHelper *)pgm_read_word(&Names[i]));
    String autorizada = (__FlashStringHelper *)pgm_read_word(&Names[i]);
    Serial.println("Tarjeta ["+String(i)+"]="+ autorizada);
    if (content.substring(1) == autorizada)
       accion();
  }

  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print(" Acerque Tag...");
  lcd.setCursor(0,1);
  lcd.print(" Priv  Geranios");
  
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.