I have a system where I need to detect the constant state of a tag present on the RC522. If the same tag stays present I need to keep to keep reading that the tag is present. If the tag is taken away then I need to know that no tag is present. If a tag switches from one to another I need to know the new one is present.
I am currently using this code:
if (mfrc522.PICC_IsNewCardPresent() && mfrc522.PICC_ReadCardSerial())
FormatBytes(szCards, mfrc522.uid.uidByte, mfrc522.uid.size);
The problem is that even though the tag is physically resting on the reader I am getting drops. I tried putting in a "debounce" where the card has to be missing for a certain amount of time, but regardless of what time I put for that I get instances that exceed it (up to 2000ms).
It looks like from the code that the reader sort of "goes to sleep" if the same card is present for an extended period of time. So is there a different way I can test that a card is present other than PICC_IsNewCardPresent?