Commit ccaf8a0e authored by matteo perini's avatar matteo perini

created my_lib

parent 9d087cfd
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
import sqlite3
def leggi_codice_rfid():
reader = SimpleMFRC522()
try:
print("Ciao, avvicina il tag RFID al ricevitore!")
id,text = reader.read()
#print(id)
#print(text)
return int(id)
except:
print("C'è stato un errore di lettura. Ripetere l'operazione!")
pass
finally:
GPIO.cleanup()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment