Skip to content

Commit 7cd29b7

Browse files
le78ldRotzbua
authored andcommitted
Removed unused variable key from examples
1 parent 7bd7a6e commit 7cd29b7

File tree

4 files changed

+0
-24
lines changed

4 files changed

+0
-24
lines changed

Diff for: examples/ChangeUID/ChangeUID.ino

-7
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,12 @@ MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
3535
/* Set your new UID here! */
3636
#define NEW_UID {0xDE, 0xAD, 0xBE, 0xEF}
3737

38-
MFRC522::MIFARE_Key key;
39-
4038
void setup() {
4139
Serial.begin(9600); // Initialize serial communications with the PC
4240
while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
4341
SPI.begin(); // Init SPI bus
4442
mfrc522.PCD_Init(); // Init MFRC522 card
4543
Serial.println(F("Warning: this example overwrites the UID of your UID changeable card, use with care!"));
46-
47-
// Prepare key - all keys are set to FFFFFFFFFFFFh at chip delivery from the factory.
48-
for (byte i = 0; i < 6; i++) {
49-
key.keyByte[i] = 0xFF;
50-
}
5144
}
5245

5346
// Setting the UID can be as simple as this:

Diff for: examples/FixBrickedUID/FixBrickedUID.ino

-7
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,12 @@
3232

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

35-
MFRC522::MIFARE_Key key;
36-
3735
void setup() {
3836
Serial.begin(9600); // Initialize serial communications with the PC
3937
while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
4038
SPI.begin(); // Init SPI bus
4139
mfrc522.PCD_Init(); // Init MFRC522 card
4240
Serial.println(F("Warning: this example clears your mifare UID, use with care!"));
43-
44-
// Prepare key - all keys are set to FFFFFFFFFFFFh at chip delivery from the factory.
45-
for (byte i = 0; i < 6; i++) {
46-
key.keyByte[i] = 0xFF;
47-
}
4841
}
4942

5043
void loop() {

Diff for: examples/MinimalInterrupt/MinimalInterrupt.ino

-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737

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

40-
MFRC522::MIFARE_Key key;
41-
4240
volatile bool bNewInt = false;
4341
byte regVal = 0x7F;
4442
void activateRec(MFRC522 mfrc522);

Diff for: examples/ReadNUID/ReadNUID.ino

-8
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838

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

41-
MFRC522::MIFARE_Key key;
42-
4341
// Init array that will store new NUID
4442
byte nuidPICC[4];
4543

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

51-
for (byte i = 0; i < 6; i++) {
52-
key.keyByte[i] = 0xFF;
53-
}
54-
5549
Serial.println(F("This code scan the MIFARE Classsic NUID."));
56-
Serial.print(F("Using the following key:"));
57-
printHex(key.keyByte, MFRC522::MF_KEY_SIZE);
5850
}
5951

6052
void loop() {

0 commit comments

Comments
 (0)