From cce2716bab663ab539407bf444081604e4ead28d Mon Sep 17 00:00:00 2001 From: Izaac Date: Wed, 14 Jun 2017 09:37:45 -0500 Subject: [PATCH 1/5] Create Read.py --- Read.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Read.py b/Read.py index 964cd47..c7ef047 100644 --- a/Read.py +++ b/Read.py @@ -41,7 +41,7 @@ while continue_reading: if status == MIFAREReader.MI_OK: # Print UID - print "Card read UID: "+str(uid[0])+","+str(uid[1])+","+str(uid[2])+","+str(uid[3]) + print "Card read UID: %s,%s,%s,%s" % (uid[0], uid[1], uid[2], uid[3]) # This is the default key for authentication key = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF] From a8ed86ba3f2afc7fddf4fef90c6a940e3a969937 Mon Sep 17 00:00:00 2001 From: Izaac Date: Wed, 14 Jun 2017 09:38:50 -0500 Subject: [PATCH 2/5] Create Write.py --- Write.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Write.py b/Write.py index d754463..de74ed0 100644 --- a/Write.py +++ b/Write.py @@ -37,7 +37,7 @@ while continue_reading: if status == MIFAREReader.MI_OK: # Print UID - print "Card read UID: "+str(uid[0])+","+str(uid[1])+","+str(uid[2])+","+str(uid[3]) + print "Card read UID: %s,%s,%s,%s" % (uid[0], uid[1], uid[2], uid[3]) # This is the default key for authentication key = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF] From 6293fa96585dde07c279d26487a7509f18ed4b2f Mon Sep 17 00:00:00 2001 From: Izaac Date: Wed, 14 Jun 2017 09:39:40 -0500 Subject: [PATCH 3/5] Create Dump.py --- Dump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dump.py b/Dump.py index ba7333a..0125801 100644 --- a/Dump.py +++ b/Dump.py @@ -37,7 +37,7 @@ while continue_reading: if status == MIFAREReader.MI_OK: # Print UID - print "Card read UID: "+str(uid[0])+","+str(uid[1])+","+str(uid[2])+","+str(uid[3]) + print "Card read UID: %s,%s,%s,%s" % (uid[0], uid[1], uid[2], uid[3]) # This is the default key for authentication key = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF] From ff6eb4ff38a58249a4c97bc066396a130751884d Mon Sep 17 00:00:00 2001 From: Izaac Date: Wed, 14 Jun 2017 11:42:25 -0500 Subject: [PATCH 4/5] Create MFRC522.py --- MFRC522.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MFRC522.py b/MFRC522.py index 6f157c2..88789f2 100644 --- a/MFRC522.py +++ b/MFRC522.py @@ -353,7 +353,7 @@ class MFRC522: if not(status == self.MI_OK) or not(backLen == 4) or not((backData[0] & 0x0F) == 0x0A): status = self.MI_ERR - print str(backLen)+" backdata &0x0F == 0x0A "+str(backData[0]&0x0F) + print "%s backdata &0x0F == 0x0A %s" % (backLen, backData[0]&0x0F) if status == self.MI_OK: i = 0 buf = [] From 4f6c382712d63591da4e9c6e74e2d0e68a2b38e4 Mon Sep 17 00:00:00 2001 From: Izaac Date: Wed, 14 Jun 2017 22:56:47 -0500 Subject: [PATCH 5/5] Create README.md --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 699a45d..7671fc0 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,20 @@ MFRC522-python ============== A small class to interface with the NFC reader Module MFRC522 on the Raspberry Pi. - This is a Python port of the example code for the NFC module MF522-AN. -##Requirements +## Requirements This code requires you to have SPI-Py installed from the following repository: https://github.com/lthiery/SPI-Py -##Examples +## Examples This repository includes a couple of examples showing how to read, write, and dump data from a chip. They are thoroughly commented, and should be easy to understand. ## Pins You can use [this](http://i.imgur.com/y7Fnvhq.png) image for reference. | Name | Pin # | Pin name | -|------|-------|------------| +|:------:|:-------:|:------------:| | SDA | 24 | GPIO8 | | SCK | 23 | GPIO11 | | MOSI | 19 | GPIO10 | @@ -26,5 +25,5 @@ You can use [this](http://i.imgur.com/y7Fnvhq.png) image for reference. | RST | 22 | GPIO25 | | 3.3V | 1 | 3V3 | -##Usage +## Usage Import the class by importing MFRC522 in the top of your script. For more info see the examples.