Read example now loops until Ctrl-C is caught.
This commit is contained in:
parent
9129dad7eb
commit
8ddc994007
1 changed files with 4 additions and 2 deletions
6
Read.py
6
Read.py
|
@ -20,6 +20,10 @@ signal.signal(signal.SIGINT, end_read)
|
||||||
# Create an object of the class MFRC522
|
# Create an object of the class MFRC522
|
||||||
MIFAREReader = MFRC522.MFRC522()
|
MIFAREReader = MFRC522.MFRC522()
|
||||||
|
|
||||||
|
# Welcome message
|
||||||
|
print "Welcome to the MFRC522 data read example"
|
||||||
|
print "Press Ctrl-C to stop."
|
||||||
|
|
||||||
# This loop keeps checking for chips. If one is near it will get the UID and authenticate
|
# This loop keeps checking for chips. If one is near it will get the UID and authenticate
|
||||||
while continue_reading:
|
while continue_reading:
|
||||||
|
|
||||||
|
@ -55,5 +59,3 @@ while continue_reading:
|
||||||
else:
|
else:
|
||||||
print "Authentication error"
|
print "Authentication error"
|
||||||
|
|
||||||
# Make sure to stop scanning for cards
|
|
||||||
continue_reading = False
|
|
||||||
|
|
Loading…
Reference in a new issue