def __init__(self): NFC.add_event_detect(NFC.NEWTAG, self.onDiskDetected) NFC.add_event_detect(NFC.REMOVETAG, self.onDiskRemoved) self.player = player() self.stopped = False self.busy = False self.adminTag = False self.UID = None
from modules.py532lib.NFC import NFC as NFC print ('Write UID') #write .UID in current dir UID_FILE = ".UID" def write_uid(uid): f = open(UID_FILE,'w') print("Write UID : %s"%str(uid)) uid = f.write(str(uid)) f.close NFC.stop() def stop(uid): NFC.stop() NFC.add_event_detect(NFC.NEWTAG,write_uid) NFC.add_event_detect(NFC.REMOVETAG,stop) print('Put the disk on plate') NFC.start()