MF522-RFID阅读器 - 检查完整的卡号

时间:2013-04-12 00:40:34

标签: locking arduino rfid

我使用的代码来自 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");
} 

如何检查完整的卡号?

1 个答案:

答案 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");
                    }