Hey, I have a Problem with my Rfid System. The rfid reader doesn't send any data to my arduino. Can you help me?
My Pins:
SDA Pin 10
SCK Pin 13
MOSI Pin 11
MISO Pin 12
GND GND
RST Pin 9
3.3V 3.3V
My Code:
#include <SPI.h>
#include <MFRC522.h>
#define RST_PIN 9 // SPI Reset Pin
#define SS_PIN 10 // SPI Slave Select Pin
MFRC522 mfrc522(SS_PIN, RST_PIN);
void setup() {
Serial.begin(9600);
SPI.begin();
mfrc522.PCD_Init();
}
void loop() {
if (mfrc522.PICC_IsNewCardPresent() && mfrc522.PICC_ReadCardSerial() ) {
Serial.print("Gelesene UID:");
for (byte i = 0; i < mfrc522.uid.size; i++) {
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i], HEX);
}
Serial.println();
mfrc522.PICC_HaltA();
delay(1000);
}
}