Skip to content

Instantly share code, notes, and snippets.

@pingswept
Created April 24, 2013 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pingswept/5454485 to your computer and use it in GitHub Desktop.
Save pingswept/5454485 to your computer and use it in GitHub Desktop.
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