I have the PIR motion detection console display wake-up thing I put together (which iirc
@RandR+ may have incorporated in his kit) also trigger a wav file player, so when the screen wakes up the room is filled with bubbling sounds.
Inside my pir_run.py file I use mpg321, as follows:
Code:
#!/usr/bin/env python
import os
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
cmd = 'xscreensaver-command -deactivate'
playsound = 'mpg321 /home/pi/bubbles.mp3'
PIR_PIN = 7
STATUS_PIN = 8
GPIO.setup(PIR_PIN, GPIO.IN)
GPIO.setup(STATUS_PIN, GPIO.OUT)
def MOTION(PIR_PIN):
os.system(cmd)
GPIO.output(8,True)
os.system(playsound)
GPIO.output(8,False)
try:
GPIO.add_event_detect(PIR_PIN, GPIO.RISING, callback=MOTION)
while 1:
time.sleep(100)
except KeyboardInterrupt:
GPIO.cleanup()
GPIO.cleanup()
I imagine one could add a similar system call to a wav file player within flow_monitor.py if one was so inclined. Could even make it tap-relative
Cheers!