add NTAG NFC
This commit is contained in:
@@ -23,6 +23,7 @@ try:
|
||||
while True:
|
||||
|
||||
reader.init()
|
||||
|
||||
(stat, tag_type) = reader.request(reader.REQIDL)
|
||||
#print('request stat:',stat,' tag_type:',tag_type)
|
||||
if stat == reader.OK:
|
||||
@@ -31,9 +32,18 @@ try:
|
||||
continue
|
||||
if stat == reader.OK:
|
||||
print("Card detected {} uid={}".format(hex(int.from_bytes(bytes(uid),"little",False)).upper(),reader.tohexstring(uid)))
|
||||
defaultKey = [255,255,255,255,255,255]
|
||||
reader.MFRC522_DumpClassic1K(uid, Start=0, End=64, keyA=defaultKey)
|
||||
print("Done")
|
||||
|
||||
if reader.IsNTAG():
|
||||
print("Got NTAG{}".format(reader.NTAG))
|
||||
reader.MFRC522_Dump_NTAG(Start=0,End=reader.NTAG_MaxPage)
|
||||
#print("Write Page 5 to 0x1,0x2,0x3,0x4 in 2 second")
|
||||
#utime.sleep(2)
|
||||
#data = [1,2,3,4]
|
||||
#reader.writeNTAGPage(5,data)
|
||||
#reader.MFRC522_Dump_NTAG(uid,Start=5,End=6)
|
||||
else:
|
||||
defaultKey = [255,255,255,255,255,255]
|
||||
reader.MFRC522_DumpClassic1K(Start=0, End=64, keyA=defaultKey)
|
||||
PreviousCard = uid
|
||||
else:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user