Reduced initial sleep time before card detection and adjusted sleep
intervals within read loops to enhance responsiveness and resource
efficiency in RFID/NFC reading routines. This adjustment aims to
minimize unnecessary delays, improving the user experience by making
card detection more prompt without compromising system stability. Moved
consistent sleeping to a `finally` block in `do_read` to ensure regular
timing intervals, regardless of read success or exceptions, contributing
to a more predictable and reliable operation.
Introduced an optional buzzer parameter to `read_task` and `do_read`
functions to provide audible feedback when an RFID/NFC card is
successfully read. This enhancement is aimed at improving user
interaction by providing immediate auditory confirmation of a successful
card scan. The buzzer is triggered for a short duration upon successful
card detection. This feature offers a more intuitive experience,
especially in environments where visual confirmation might be
challenging to notice.
A GPIO pin is configured as output for the buzzer control, ensuring
minimal impact on the code's structure and maintaining backward
compatibility by keeping the buzzer parameter optional.