Created
January 6, 2017 07:21
-
-
Save sourceperl/b73595f93cdb9a2846f739544e6fe49b to your computer and use it in GitHub Desktop.
QR code tools
This file contains hidden or 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/env python3 | |
import os | |
import sys | |
if __name__ == '__main__': | |
for line in sys.stdin: | |
sys.stdout.write(line) | |
if 'keyword1' in line: | |
print('play bip 1') | |
os.system('aplay /home/pi/Music/bip1.wav >/dev/null 2>&1') | |
elif 'keyword2' in line: | |
print('play bip 2') | |
os.system('aplay /home/pi/Music/bip2.wav >/dev/null 2>&1') |
This file contains hidden or 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
#!/bin/bash | |
# read QR code from /dev/video0 send decode string to echo python script | |
zbarcam /dev/video0 --prescale=320x240 --raw -Sdisable -Sqrcode.enable --nodisplay | ./echo.py |
This file contains hidden or 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
#!/bin/bash | |
# add QR code tools | |
sudo apt-get install zbar-tools qrencode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment