Example #1
0
    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
Example #2
0
def write_uid(uid):
    f = open(UID_FILE,'w')
    print("Write UID : %s"%str(uid))
    uid = f.write(str(uid))
    f.close
    NFC.stop()
Example #3
0
def stop(uid):
    NFC.stop()
Example #4
0
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()
Example #5
0
 def start(self):
     try :
        NFC.start()
     except :
         NFC.start()         
     GPIO.cleanup()