Skip to content

Commit e4aa22d

Browse files
committed
Updated RFID
1 parent b5bea3c commit e4aa22d

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

E19-RFID-RC522/RFID-RC5222-challenge.ino

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,17 @@
3030
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
3131
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
3232
*/
33-
3433
#include <SPI.h> // SPI library
3534
#include <MFRC522.h> // MFRC522 library
3635

3736
const int pinRST = 9; // Reset pin
3837
const int pinSS = 10; // Serial data pin
3938

40-
const String cardIdValid = "6A165383"; // Allowed card ID
39+
const String cardIdValid = "6A165383"; // Valid Card ID
4140

4241
MFRC522 mfrc522(pinSS, pinRST); // Initialise the MFRC522 on pinSS and pinRST
4342

44-
// Read the card id
43+
// Read the ID of the RFID card
4544
void getCardID() {
4645

4746
// If there is a new card found AND
@@ -64,16 +63,16 @@ void getCardID() {
6463
Serial.print("Read card ID: ");
6564
Serial.println(cardIdRead);
6665

67-
// If the card ID is allowed
66+
// if the cardID is valid
6867
if (cardIdRead == cardIdValid) {
69-
Serial.println("Card allowed");
68+
Serial.println("Access granted");
7069
} else {
71-
Serial.println("Card not allowed");
70+
Serial.println("Access denied");
7271
}
7372

7473
Serial.println("");
7574

76-
// Stop reading
75+
// Stop reading the card
7776
mfrc522.PICC_HaltA();
7877
}
7978
}

0 commit comments

Comments
 (0)