#include <IRremote.h>
#include <LiquidCrystal.h>
const int RECV_PIN = 11; // IR Receiver output pin
IRrecv irrecv(RECV_PIN);
decode_results results;
LiquidCrystal lcd(7, 6, 5, 4, 3, 2); // RS, E, D4, D5, D6, D7
void setup() {
Serial.begin(9600);
irrecv.enableIRIn(); // Start the IR receiver
lcd.begin(16, 2); // Initialize the LCD
lcd.print("IR RFID System");
lcd.setCursor(0, 1);
lcd.print("Ready");
delay(2000);
lcd.clear();
}
void loop() {
if (irrecv.decode(&results)) {
unsigned long irCode = results.value;
lcd.clear();
lcd.print("Tag detected:");
lcd.setCursor(0, 1);
lcd.print(irCode, HEX);
irrecv.resume(); // Receive the next value
delay(1000); // Delay to avoid multiple reads
lcd.clear();
}
}