|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import time, json
|
|
|
|
|
import RPi.GPIO as GPIO
|
|
|
|
|
import keyboard
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
pin_config = {}
|
|
|
|
@ -16,7 +17,9 @@ if __name__ == '__main__':
|
|
|
|
|
GPIO.setup(pin_config['tools_red_LED'], GPIO.OUT)
|
|
|
|
|
GPIO.setup(pin_config['tools_grn_LED'], GPIO.OUT)
|
|
|
|
|
while True:
|
|
|
|
|
cardID = raw_input("Enter card ID: ")
|
|
|
|
|
print "Enter card ID:"
|
|
|
|
|
cardID_input = keyboard.record(until='enter')
|
|
|
|
|
cardID = keyboard.get_typed_strings(cardID_input)[0]
|
|
|
|
|
event = {}
|
|
|
|
|
event["time"] = time.time()
|
|
|
|
|
event["cardID"] = cardID
|
|
|
|
|