Skip to content

Commit

Permalink
Removed unused variable key from examples
Browse files Browse the repository at this point in the history
  • Loading branch information
le78ld authored and Rotzbua committed Feb 27, 2024
1 parent 7bd7a6e commit 7cd29b7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 24 deletions.
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

0 comments on commit 7cd29b7

Please sign in to comment.