Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unused variable key from examples #620

Merged
Merged
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
7 changes: 0 additions & 7 deletions examples/ChangeUID/ChangeUID.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,12 @@ MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
/* Set your new UID here! */
#define NEW_UID {0xDE, 0xAD, 0xBE, 0xEF}

MFRC522::MIFARE_Key key;

void setup() {
Serial.begin(9600); // Initialize serial communications with the PC
while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card
Serial.println(F("Warning: this example overwrites the UID of your UID changeable card, use with care!"));

// Prepare key - all keys are set to FFFFFFFFFFFFh at chip delivery from the factory.
for (byte i = 0; i < 6; i++) {
key.keyByte[i] = 0xFF;
}
}

// Setting the UID can be as simple as this:
Expand Down
7 changes: 0 additions & 7 deletions examples/FixBrickedUID/FixBrickedUID.ino
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,12 @@

MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance

MFRC522::MIFARE_Key key;

void setup() {
Serial.begin(9600); // Initialize serial communications with the PC
while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card
Serial.println(F("Warning: this example clears your mifare UID, use with care!"));

// Prepare key - all keys are set to FFFFFFFFFFFFh at chip delivery from the factory.
for (byte i = 0; i < 6; i++) {
key.keyByte[i] = 0xFF;
}
}

void loop() {
Expand Down
2 changes: 0 additions & 2 deletions examples/MinimalInterrupt/MinimalInterrupt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@

MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.

MFRC522::MIFARE_Key key;

volatile bool bNewInt = false;
byte regVal = 0x7F;
void activateRec(MFRC522 mfrc522);
Expand Down
8 changes: 0 additions & 8 deletions examples/ReadNUID/ReadNUID.ino
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@

MFRC522 rfid(SS_PIN, RST_PIN); // Instance of the class

MFRC522::MIFARE_Key key;

// Init array that will store new NUID
byte nuidPICC[4];

Expand All @@ -48,13 +46,7 @@ void setup() {
SPI.begin(); // Init SPI bus
rfid.PCD_Init(); // Init MFRC522

for (byte i = 0; i < 6; i++) {
key.keyByte[i] = 0xFF;
}

Serial.println(F("This code scan the MIFARE Classsic NUID."));
Serial.print(F("Using the following key:"));
printHex(key.keyByte, MFRC522::MF_KEY_SIZE);
}

void loop() {
Expand Down
Loading