mfrc522 function for .isCardPresent () ?

I have reviewed rfidmifare.doc.

I want to keep an led on as long as any RFID card with a readable uid is present.

All the examples use mfrc522.isNewCardPresent() which won't work for my needs.

I need to keep reading to see if any card is still there and keep an LED light. If a card is not there (no uid), then turn the led off.


Documentation states to do a .PICC_IsNewCardPresent() .PICC_RequestA() .PICC_WakeupA()
before .PICC_ReadCardSerial

.IsNewCardPresent compiles, but the other 2 don't.

I tried

if (mfrc522.PICC_RequestA() && mfrc522.PICC_ReadCardSerial()) { . . . .

and

if (mfrc522.PICC_WakeUp() && mfrc522.PICC_ReadCardSerial()) { . . . .

but got
"no matching function for call to 'MFRC522::PICC_RequestA()'"


So how would I do a mfrc.isCardPresent()? or simply put get a valid uid without doing a .IsNewCardPresent?

my work around is to save the last uid.

It seems that .isNewcard toggles on and off much like a blinking led if a card is left in.

So I just save the last id and any future comparison checks if (uid > 0) OR (uidLast > 0) then {turn light on}.

Hopes this helps someone in the future.

hi,

Would you mind sharing your implementation of "sensing" card is present all the time?

I have similar problem, i.e. I place a card on a reader and would like to write data to it at random interval times, so everytime I go back to detecting card, mfrc522.PICC_IsNewCardPresent() fails on/off as you said.

Thanks.