Skip to content

Commit

Permalink
add special sound and audio files
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasBerbesson committed Jun 16, 2016
1 parent 4af5102 commit 7ee34df
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added applause.wav
Binary file not shown.
Binary file added blop.wav
Binary file not shown.
17 changes: 14 additions & 3 deletions notify.py
Expand Up @@ -18,6 +18,8 @@

# Time in seconds between two requests
REFRESH_TIME = 1
# Make a special sound every 100 followers
APPLAUSE_THRESHOLD = 100
# Raspberry GPIO where the RED pin of your LED strip is connected
RED_PIN = 9
# Raspberry GPIO where the GREEN pin of your LED strip is connected
Expand Down Expand Up @@ -52,15 +54,24 @@

if new_likes - likes > 0:
blue = 1
subprocess.call(["sudo", "omxplayer", "blop.wav"])
if new_likes % APPLAUSE_THRESHOLD == 0:
subprocess.call(["sudo", "omxplayer", "applause.wav"])
else:
subprocess.call(["sudo", "omxplayer", "blop.wav"])
sleep(0.1)
if new_subscribers - subscribers > 0:
red = 1
subprocess.call(["sudo", "omxplayer", "blop.wav"])
if new_subscribers % APPLAUSE_THRESHOLD == 0:
subprocess.call(["sudo", "omxplayer", "applause.wav"])
else:
subprocess.call(["sudo", "omxplayer", "blop.wav"])
sleep(0.1)
if new_followers - followers > 0:
green = 1
subprocess.call(["sudo", "omxplayer", "blop.wav"])
if new_followers % APPLAUSE_THRESHOLD == 0:
subprocess.call(["sudo", "omxplayer", "applause.wav"])
else:
subprocess.call(["sudo", "omxplayer", "blop.wav"])
sleep(0.1)
led.color = (red, green, blue)
sleep(1)
Expand Down

0 comments on commit 7ee34df

Please sign in to comment.