pi-rc522
pi-rc522 copied to clipboard
Add timeout to wait_for_tag method
Based on @tlongeri 's suggestion in https://github.com/ondryaso/pi-rc522/issues/44 I addded the timeout functionality to the wait_for_tag method so that it will return after a given number of seconds. The timeout param is optional with default value of 0 (=no timeout) so that existing users of the library will not have any change in functionality unless they provide the new param.
This functionality is useful for detecting that the reader could not find a RFID tag, e.g. the card was removed.
You're right. I updated the code to handle that case.
Hi how do I use this in my code?