From 1a06580bd48a8b73d952f426e18efe7619fdab13 Mon Sep 17 00:00:00 2001 From: bton Date: Wed, 8 May 2024 18:03:19 +0200 Subject: [PATCH] bye bye while --- NFC_Reader.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/NFC_Reader.py b/NFC_Reader.py index c16ece3..dd642c5 100644 --- a/NFC_Reader.py +++ b/NFC_Reader.py @@ -29,13 +29,12 @@ def onTagSense(tag): return False def start_nfc_normal(): - device = get_reader() - clf = nfc.ContactlessFrontend(device) - clf.open(device) - while True: + device = get_reader() + clf = nfc.ContactlessFrontend(device) + clf.open(device) clf.connect(rdwr={'on-connect': onTagSense, 'beep-on-connect': True }) time.sleep(0.75) - + clf.close() if __name__ == "__main__": start_nfc_normal()