Read example now loops until Ctrl-C is caught.

This commit is contained in:
Mario Gomez 2014-07-18 21:15:31 -06:00
parent 9129dad7eb
commit 8ddc994007

View file

@ -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