|
|
|
@ -2,8 +2,29 @@ import time, json
|
|
|
|
|
import RPi.GPIO as GPIO
|
|
|
|
|
import keyboard
|
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
pin_config = []
|
|
|
|
|
|
|
|
|
|
def btnBlink():
|
|
|
|
|
for i in range(3):
|
|
|
|
|
GPIO.output(pin_config['fridge_red_LED'], GPIO.HIGH)
|
|
|
|
|
time.sleep(0.01)
|
|
|
|
|
GPIO.output(pin_config['fridge_grn_LED'], GPIO.HIGH)
|
|
|
|
|
time.sleep(0.01)
|
|
|
|
|
GPIO.output(pin_config['tools_red_LED'], GPIO.HIGH)
|
|
|
|
|
time.sleep(0.01)
|
|
|
|
|
GPIO.output(pin_config['tools_grn_LED'], GPIO.HIGH)
|
|
|
|
|
time.sleep(0.01)
|
|
|
|
|
GPIO.output(pin_config['fridge_red_LED'], GPIO.LOW)
|
|
|
|
|
time.sleep(0.01)
|
|
|
|
|
GPIO.output(pin_config['fridge_grn_LED'], GPIO.LOW)
|
|
|
|
|
time.sleep(0.01)
|
|
|
|
|
GPIO.output(pin_config['tools_red_LED'], GPIO.LOW)
|
|
|
|
|
time.sleep(0.01)
|
|
|
|
|
GPIO.output(pin_config['tools_grn_LED'], GPIO.LOW)
|
|
|
|
|
time.sleep(0.01)
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
pin_config = []
|
|
|
|
|
with open('pin_config.json') as pin_config_stream:
|
|
|
|
|
pin_config = json.load(pin_config_stream)
|
|
|
|
|
if pin_config['mode'] == 'BOARD':
|
|
|
|
@ -68,6 +89,7 @@ if __name__ == '__main__':
|
|
|
|
|
GPIO.output(pin_config['tools_red_LED'], GPIO.LOW)
|
|
|
|
|
wait = False
|
|
|
|
|
except:
|
|
|
|
|
btnBlink()
|
|
|
|
|
print "Card not registered."
|
|
|
|
|
history = []
|
|
|
|
|
try:
|
|
|
|
|