huhm23 / AL-Aisle-Locator-

GNU General Public License v3.0
0 stars 0 forks source link

RFID for members #52

Open huhm23 opened 1 year ago

huhm23 commented 1 year ago

cd AL-Aisle-Locator-/RFID git clone https://github.com/pimylifeup/MFRC522-python cd MFRC522-python sudo python3 setup.py install cd AL-Aisle-Locator-/RFID

huhm23 commented 1 year ago

import RPi.GPIO as GPIO import sys import time from mfrc522 import SimpleMFRC522

reader = SimpleMFRC522()

print("Hold a tag near the reader") print("Reading tag in 1 second...") time.sleep(1) id = reader.read_id_no_block()

if id: print(hex(id)) else: print("No tag detected")

if hex(id) == "0xb883bd33b5": print("Hello Haelyne") elif hex(id) == "0x944f08aa79": print("Hello Dean") elif hex(id) == "0x64ff0daa3c": print("Hello Dana") elif hex(id) == "0xb4b32baa86": print("Hello Professor Fund") elif hex(id) == "0x34e619aa61": print("Hello Ufuk") else: print("Nothing was scanned. Please try again.")

GPIO.cleanup()

huhm23 commented 1 year ago

Image