MFRC522 called from yield()

Win 10 US 64, IDE 1.8.19, MFRC522 1.4.10

I am trying to read from an RFID tag using the DumpInfo example program from the MFRC522 library after replacing Serial with SerialUSB and (F("...")) with ("..."). It works fine. However, if I try to call

mfrc522.PICC_IsNewCardPresent()

and/or

mfrc522.PICC_DumpToSerial(&(mfrc522.uid))

from yield() I lose the USB connection, and I have to double click to reload the program.

So the question is does anyone have any success with using the MFCR522 library with an Arduino Zero and calling from yield()?

Why do you think that you need yield() ?

Because then it is also called when the delay() is used etc.

Would be better to write code without delay() ?

May be. the case. But I and others use delays often in Arduino. Also by using the yield() the USB handling is straight forward in a lot of Arduino Zero code found elsewhere.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.