master
Jared 8 years ago
parent 1cb5200797
commit 92119ef5d2

@ -3,14 +3,14 @@ import RPi.GPIO as GPIO
import keyboard
if __name__ == '__main__':
pin_config = {}
pin_config = []
with open('pin_config.json') as pin_config_stream:
pin_config = json.load(pin_config_stream)
if pin_config['mode'] == 'BOARD':
GPIO.setmode(GPIO.BOARD)
else:
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin_config['frigde_btn'], GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(pin_config['fridge_btn'], GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(pin_config['tools_btn'], GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(pin_config['fridge_red_LED'], GPIO.OUT)
GPIO.setup(pin_config['fridge_grn_LED'], GPIO.OUT)
@ -70,4 +70,4 @@ if __name__ == '__main__':
history.append(event)
with open('history.json', 'w') as outfile:
json.dump(history, outfile)

@ -5,5 +5,5 @@
"fridge_red_LED" : 31,
"fridge_grn_LED" : 33,
"tools_red_LED" : 35,
"tools_grn_LED" : 37,
}
"tools_grn_LED" : 37
}

@ -1,3 +1,5 @@
#!/bin/sh
cd /home/pi/ELAB-RFID-locks
export FLASK_APP=server.py
sudo python cardlistener.py&
flask run

Loading…
Cancel
Save