Merge pull request #162 from Rotzbua/example-codestyle
Upd some examples codestyle Everything looks good, thank you @Rotzbua
This commit is contained in:
@@ -1,28 +1,15 @@
|
||||
/*
|
||||
* MFRC522 - Library to use ARDUINO RFID MODULE KIT 13.56 MHZ WITH TAGS SPI W AND R BY COOQROBOT.
|
||||
* The library file MFRC522.h has a wealth of useful info. Please read it.
|
||||
* The functions are documented in MFRC522.cpp.
|
||||
*
|
||||
* Based on code Dr.Leong ( WWW.B2CQSHOP.COM )
|
||||
* Created by Miguel Balboa (circuitito.com), Jan, 2012.
|
||||
* Rewritten by Søren Thing Andersen (access.thing.dk), fall of 2013 (Translation to English, refactored, comments, anti collision, cascade levels.)
|
||||
* Extended by Tom Clement with functionality to write to sector 0 of UID changeable Mifare cards.
|
||||
*
|
||||
* Released into the public domain.
|
||||
* --------------------------------------------------------------------------------------------------------------------
|
||||
* Example to change UID of changeable MIFARE card.
|
||||
* --------------------------------------------------------------------------------------------------------------------
|
||||
* This is a MFRC522 library example; for further details and other examples see: https://github.com/miguelbalboa/rfid
|
||||
*
|
||||
* This sample shows how to set the UID on a UID changeable MIFARE card.
|
||||
* NOTE: for more informations read the README.rst
|
||||
*
|
||||
* @author Tom Clement
|
||||
* @license Released into the public domain.
|
||||
*
|
||||
----------------------------------------------------------------------------- empty_skull
|
||||
|
||||
- Aggiunti pin per arduino Mega
|
||||
- Scritto semplice codice per la scrittura e lettura
|
||||
|
||||
- add pin configuration for arduino mega
|
||||
- write simple read/write Code for new entry user
|
||||
|
||||
http://mac86project.altervista.org/
|
||||
|
||||
----------------------------------------------------------------------------- Nicola Coppola
|
||||
* Typical pin layout used:
|
||||
* -----------------------------------------------------------------------------------------
|
||||
* MFRC522 Arduino Arduino Arduino Arduino Arduino
|
||||
@@ -34,19 +21,19 @@
|
||||
* SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16
|
||||
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
|
||||
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
|
||||
*
|
||||
* The reader can be found on eBay for around 5 dollars. Search for "mf-rc522" on ebay.com.
|
||||
*/
|
||||
|
||||
#include <SPI.h>
|
||||
#include <MFRC522.h>
|
||||
|
||||
#define RST_PIN 9 // Configurable, see typical pin layout above
|
||||
#define SS_PIN 10 // Configurable, see typical pin layout above
|
||||
|
||||
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
|
||||
|
||||
/* Set your new UID here! */
|
||||
#define NEW_UID {0xDE, 0xAD, 0xBE, 0xEF}
|
||||
#define SS_PIN 10
|
||||
#define RST_PIN 9
|
||||
|
||||
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
|
||||
MFRC522::MIFARE_Key key;
|
||||
|
||||
void setup() {
|
||||
|
||||
@@ -1,29 +1,24 @@
|
||||
/*
|
||||
* ----------------------------------------------------------------------------
|
||||
* This is a MFRC522 library example; see https://github.com/miguelbalboa/rfid
|
||||
* for further details and other examples.
|
||||
* --------------------------------------------------------------------------------------------------------------------
|
||||
* Example sketch/program showing how to read data from a PICC to serial.
|
||||
* --------------------------------------------------------------------------------------------------------------------
|
||||
* This is a MFRC522 library example; for further details and other examples see: https://github.com/miguelbalboa/rfid
|
||||
*
|
||||
* NOTE: The library file MFRC522.h has a lot of useful info. Please read it.
|
||||
* Example sketch/program showing how to read data from a PICC (that is: a RFID Tag or Card) using a MFRC522 based RFID
|
||||
* Reader on the Arduino SPI interface.
|
||||
*
|
||||
* Released into the public domain.
|
||||
* ----------------------------------------------------------------------------
|
||||
* Example sketch/program showing how to read data from a PICC (that is: a RFID
|
||||
* Tag or Card) using a MFRC522 based RFID Reader on the Arduino SPI interface.
|
||||
* When the Arduino and the MFRC522 module are connected (see the pin layout below), load this sketch into Arduino IDE
|
||||
* then verify/compile and upload it. To see the output: use Tools, Serial Monitor of the IDE (hit Ctrl+Shft+M). When
|
||||
* you present a PICC (that is: a RFID Tag or Card) at reading distance of the MFRC522 Reader/PCD, the serial output
|
||||
* will show the ID/UID, type and any data blocks it can read. Note: you may see "Timeout in communication" messages
|
||||
* when removing the PICC from reading distance too early.
|
||||
*
|
||||
* When the Arduino and the MFRC522 module are connected (see the pin layout
|
||||
* below), load this sketch into Arduino IDE then verify/compile and upload it.
|
||||
* To see the output: use Tools, Serial Monitor of the IDE (hit Ctrl+Shft+M).
|
||||
* When you present a PICC (that is: a RFID Tag or Card) at reading distance
|
||||
* of the MFRC522 Reader/PCD, the serial output will show the ID/UID, type and
|
||||
* any data blocks it can read. Note: you may see "Timeout in communication"
|
||||
* messages when removing the PICC from reading distance too early.
|
||||
* If your reader supports it, this sketch/program will read all the PICCs presented (that is: multiple tag reading).
|
||||
* So if you stack two or more PICCs on top of each other and present them to the reader, it will first output all
|
||||
* details of the first and then the next PICC. Note that this may take some time as all data blocks are dumped, so
|
||||
* keep the PICCs at reading distance until complete.
|
||||
*
|
||||
* If your reader supports it, this sketch/program will read all the PICCs
|
||||
* presented (that is: multiple tag reading). So if you stack two or more
|
||||
* PICCs on top of each other and present them to the reader, it will first
|
||||
* output all details of the first and then the next PICC. Note that this
|
||||
* may take some time as all data blocks are dumped, so keep the PICCs at
|
||||
* reading distance until complete.
|
||||
* @license Released into the public domain.
|
||||
*
|
||||
* Typical pin layout used:
|
||||
* -----------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,28 +1,14 @@
|
||||
/*
|
||||
* MFRC522 - Library to use ARDUINO RFID MODULE KIT 13.56 MHZ WITH TAGS SPI W AND R BY COOQROBOT.
|
||||
* The library file MFRC522.h has a wealth of useful info. Please read it.
|
||||
* The functions are documented in MFRC522.cpp.
|
||||
* --------------------------------------------------------------------------------------------------------------------
|
||||
* Example sketch/program to fix a broken UID changeable MIFARE cards.
|
||||
* --------------------------------------------------------------------------------------------------------------------
|
||||
* This is a MFRC522 library example; for further details and other examples see: https://github.com/miguelbalboa/rfid
|
||||
*
|
||||
* Based on code Dr.Leong ( WWW.B2CQSHOP.COM )
|
||||
* Created by Miguel Balboa (circuitito.com), Jan, 2012.
|
||||
* Rewritten by Søren Thing Andersen (access.thing.dk), fall of 2013 (Translation to English, refactored, comments, anti collision, cascade levels.)
|
||||
* Extended by Tom Clement with functionality to write to sector 0 of UID changeable Mifare cards.
|
||||
* This sample shows how to fix a broken UID changeable MIFARE cards that have a corrupted sector 0.
|
||||
*
|
||||
* Released into the public domain.
|
||||
* @author Tom Clement
|
||||
* @license Released into the public domain.
|
||||
*
|
||||
* This sample shows how to fix a UID changeable MIFARE cards that have a corrupted sector 0.
|
||||
*
|
||||
----------------------------------------------------------------------------- empty_skull
|
||||
|
||||
- Aggiunti pin per arduino Mega
|
||||
- Scritto semplice codice per la scrittura e lettura
|
||||
|
||||
- add pin configuration for arduino mega
|
||||
- write simple read/write Code for new entry user
|
||||
|
||||
http://mac86project.altervista.org/
|
||||
|
||||
----------------------------------------------------------------------------- Nicola Coppola
|
||||
* Typical pin layout used:
|
||||
* -----------------------------------------------------------------------------------------
|
||||
* MFRC522 Arduino Arduino Arduino Arduino Arduino
|
||||
@@ -34,17 +20,16 @@
|
||||
* SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16
|
||||
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
|
||||
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
|
||||
*
|
||||
* The reader can be found on eBay for around 5 dollars. Search for "mf-rc522" on ebay.com.
|
||||
*/
|
||||
|
||||
#include <SPI.h>
|
||||
#include <MFRC522.h>
|
||||
|
||||
#define SS_PIN 10
|
||||
#define RST_PIN 9
|
||||
#define RST_PIN 9 // Configurable, see typical pin layout above
|
||||
#define SS_PIN 10 // Configurable, see typical pin layout above
|
||||
|
||||
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
|
||||
|
||||
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
|
||||
MFRC522::MIFARE_Key key;
|
||||
|
||||
void setup() {
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
*
|
||||
* This example test the firmware of your MFRC522 reader module, only known version can be checked. If the test passed
|
||||
* it do not mean that your module is faultless! Some modules have bad or broken antennas or the PICC is broken.
|
||||
*
|
||||
* NOTE: for more informations read the README.rst
|
||||
*
|
||||
* Released into the public domain.
|
||||
* @author Rotzbua
|
||||
* @license Released into the public domain.
|
||||
*
|
||||
* Typical pin layout used:
|
||||
* -----------------------------------------------------------------------------------------
|
||||
@@ -22,8 +22,6 @@
|
||||
* SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16
|
||||
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
|
||||
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
|
||||
*
|
||||
* @author Rotzbua
|
||||
*/
|
||||
|
||||
#include <SPI.h>
|
||||
|
||||
@@ -22,9 +22,10 @@
|
||||
#include <SPI.h>
|
||||
#include <MFRC522.h>
|
||||
|
||||
#define SS_PIN 10 //Arduino Uno
|
||||
#define RST_PIN 9
|
||||
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
|
||||
#define RST_PIN 9 // Configurable, see typical pin layout above
|
||||
#define SS_PIN 10 // Configurable, see typical pin layout above
|
||||
|
||||
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600); // Initialize serial communications with the PC
|
||||
|
||||
Reference in New Issue
Block a user