hi, i want to tag many RFID cards and save each one of them to the other parameter. But I got some problem. The picture is the serial monitor when i tagged one RFID card. And i want you guy’s advice. Thank you.
here is the sourcecode.
#include <MFRC522.h>
#include<SPI.h>
#define RST_PIN 9
#define SS_PIN 10
MFRC522 mfrc(SS_PIN, RST_PIN);
byte drone[5][4];
void setup(){
Serial.begin(9600);
SPI.begin();
mfrc.PCD_Init();
}
void loop(){
if ( !mfrc.PICC_IsNewCardPresent() || !mfrc.PICC_ReadCardSerial() ) {
delay(500);
return;
}
Serial.print("Card UID:");
for(byte j=0;j<6;j++){
for (byte i = 0; i < 4; i++) {
Serial.print(mfrc.uid.uidByte[i],HEX);
drone[j][i]=(mfrc.uid.uidByte[i]);
Serial.print(" ");
}
Serial.println("\n");
Serial.print("drone UID : ");
for(byte k=0;k<4;k++){
Serial.print(drone[j][k]);
Serial.print(" ");
}
}
}