Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Python script that looks at Wiegand card reader and sends new reads to a 4D Systems LCD screen
#!/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
You can’t perform that action at this time.