Python script that looks at Wiegand card reader and sends new reads to a 4D Systems LCD screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from time import sleep | |
from fourdsystems import clear_lcd, put_string | |
lastCard=" " | |
clear_lcd() | |
while(1): | |
with open('/sys/kernel/wiegand/read', 'r') as f: | |
card = f.read().strip().split(':') | |
if lastCard != card[0]: | |
lastCard = card[0] | |
print card | |
put_string('Read #{0}, facility: {1}, card: {2}\n'.format(card[0], card[1], card[2])) | |
sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment