Skip to content

ja #669

Description

@jackiebouy17-droid

#include <SPI.h>
#include <MFRC522.h>

#define SS_PIN 10
#define RST_PIN 9

MFRC522 rfid(SS_PIN, RST_PIN);

void setup() {
Serial.begin(9600);
SPI.begin();
rfid.PCD_Init();

Serial.println("Place your RFID card near the reader...");
}

void loop() {

// Look for new card
if (!rfid.PICC_IsNewCardPresent())
return;

// Select one of the cards
if (!rfid.PICC_ReadCardSerial())
return;

Serial.print("Card UID: ");

for (byte i = 0; i < rfid.uid.size; i++) {
if (rfid.uid.uidByte[i] < 0x10)
Serial.print("0");

Serial.print(rfid.uid.uidByte[i], HEX);
Serial.print(" ");

}

Serial.println();

rfid.PICC_HaltA();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions