我使用的代码来自 How to get started with the Mifare MF522-AN and Arduino 。
问题是,代码只检查第一对卡号:
if(serNum[0] == 88) { // Is the first pair equal to 88?
Serial.println("Hello Grant");
}
如何检查完整的卡号?
答案 0 :(得分:1)
希望此代码可以帮助您:
String FullSerial = "";
FullSerial += serNum[0];
FullSerial += serNum[1];
FullSerial += serNum[2];
FullSerial += serNum[3];
FullSerial += serNum[4];
if(FullSerial == "THE_RFID") { //Change the Condition
Serial.println("Hello Grant");
}