Skip to content

Instantly share code, notes, and snippets.

@tbuwadi

tbuwadi/read.py Secret

Last active February 5, 2022 05:04
Show Gist options
  • Save tbuwadi/f9c884e88419774d9d3427ddcf805733 to your computer and use it in GitHub Desktop.
Save tbuwadi/f9c884e88419774d9d3427ddcf805733 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
reader = SimpleMFRC522()
try:
print("Waiting for you to scan an RFID sticker/card")
id = reader.read()[0]
print("The ID for this card is:", id)
finally:
GPIO.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment