Move RFID setup to new section
Let's not mix this with GPIO stuff. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
d3c799914a
commit
54ed9e258e
27
doors.py
27
doors.py
|
@ -10,6 +10,8 @@ RED_LED = 11
|
|||
GREEN_LED = 13
|
||||
DOOR_STRIKE = 15
|
||||
|
||||
|
||||
|
||||
####################
|
||||
# #
|
||||
# Set up GPIO Pins #
|
||||
|
@ -20,14 +22,6 @@ import atexit
|
|||
import RPi.GPIO as GPIO
|
||||
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
|
||||
|
||||
#Find the RFID as a USB device
|
||||
#TODO: script should find it if not at USB0
|
||||
RFID_SERIAL = serial.Serial('/dev/ttyUSB0', 2400, timeout=1)
|
||||
|
||||
GPIO.setmode(GPIO.BOARD)
|
||||
atexit.register(GPIO.cleanup)
|
||||
|
||||
|
@ -57,6 +51,23 @@ def close_door():
|
|||
GPIO.output(GREEN_LED, lowVoltage)
|
||||
GPIO.output(RED_LED, highVoltage)
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# #
|
||||
# Set up RFID Reader #
|
||||
# #
|
||||
######################
|
||||
#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
|
||||
|
||||
#Find the RFID as a USB device
|
||||
#TODO: script should find it if not at USB0
|
||||
RFID_SERIAL = serial.Serial('/dev/ttyUSB0', 2400, timeout=1)
|
||||
|
||||
|
||||
|
||||
#############################################
|
||||
# #
|
||||
# Verify a key with openings.workantile.com #
|
||||
|
|
Loading…
Reference in New Issue