import RPi.GPIO as GPIO from mfrc522 import SimpleMFRC522 # Initialize the reader reader = SimpleMFRC522() try: print("Place your card on the reader...") id, text = reader.read() print("Card ID:", id) print("Card Data:", text) except Exception as e: print("An error occurred:", str(e)) finally: GPIO.cleanup()