public
Created

Code for listening to a USB RFID reader on the Rascal and then triggering an audio file to play when a card is detected. The code in action: https://vimeo.com/71829779

  • Download Gist
sound-trigger.py
Python
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env python
 
import sys
import subprocess as subp
 
while(1):
sys.stdin = open('/dev/tty0', 'r')
rfid_data = raw_input()
print "Read code from RFID reader: {0}".format(rfid_data)
subp.Popen('aplay --buffer-time=100000 /home/root/calm-16-bit-pcm.wav', shell=True)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.