Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MFRC522.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class MFRC522:
def __init__(self, dev='/dev/spidev0.0', spd=1000000):
spi.openSPI(device=dev,speed=spd)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(22, GPIO.OUT)
GPIO.setup(self.NRSTPD, GPIO.OUT)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hunk seems already taken care of in 6896370 (and a follow up to make it actually work (cf7f9ec, #52)

GPIO.output(self.NRSTPD, 1)
self.MFRC522_Init()

Expand Down
10 changes: 7 additions & 3 deletions Read.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import RPi.GPIO as GPIO
import MFRC522
import signal
import time

continue_reading = True

Expand Down Expand Up @@ -32,16 +33,18 @@ def end_read(signal,frame):

# If a card is found
if status == MIFAREReader.MI_OK:
print "Card detected"
localtime = time.asctime( time.localtime(time.time()) )
print "Card detected " + localtime
Comment on lines -35 to +37
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an unrelated change that deserves a separate commit


# Get the UID of the card
(status,uid) = MIFAREReader.MFRC522_Anticoll()

# If we have the UID, continue
if status == MIFAREReader.MI_OK:

# Print UID
print "Card read UID: "+str(uid[0])+","+str(uid[1])+","+str(uid[2])+","+str(uid[3])
# Print UID - usually 4 to 5 bytes in length.
#
print "Card read UID: "+str(uid)

# This is the default key for authentication
key = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]
Expand All @@ -59,3 +62,4 @@ def end_read(signal,frame):
else:
print "Authentication error"

time.sleep(10)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this good for?