From 4b8b596ae3fbe44dada23c82c76558fbcc089c80 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Tue, 7 Apr 2015 14:27:02 -0400 Subject: [PATCH] Move RFID comment block Put it with the RFID loop, to make it obvious where RFID stuff happens. Signed-off-by: Anna Schumaker --- doors.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/doors.py b/doors.py index 01bcd54..456ece4 100644 --- a/doors.py +++ b/doors.py @@ -71,19 +71,6 @@ def close_door(): import time -#python-pyserial package. Not sure we need this. Grabbed based on -#http://allenmlabs.blogspot.se/2013/01/raspberry-pi-parallax-rfid-reader.html -import serial -###################### -# # -# Set up RFID Reader # -# # -###################### - -RFID_SERIAL = serial.Serial(RFID_PATH, 2400, timeout=1) - - - from urllib import request ############################################# # # @@ -100,11 +87,23 @@ def verify_key(key): close_door() + +#python-pyserial package. Not sure we need this. Grabbed based on +#http://allenmlabs.blogspot.se/2013/01/raspberry-pi-parallax-rfid-reader.html +import serial +################### +# # +# Run RFID Reader # +# # +################### + +RFID_SERIAL = serial.Serial(RFID_PATH, 2400, timeout=1) + while True: string = RFID_SERIAL.read(12) if len(string) == 0: - print("No tag read") - continue + print("No tag read") + continue else: key = string[1:11] #exclude start x0A and stop x0D bytes print(key)