Skip to content

Instantly share code, notes, and snippets.

@valbeat
Created August 18, 2015 10:16
Show Gist options
  • Save valbeat/8dc6f2a53cef4a6933d4 to your computer and use it in GitHub Desktop.
Save valbeat/8dc6f2a53cef4a6933d4 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from time import sleep
import os
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(13, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(19, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(26, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
while 1:
if GPIO.input(13):
os.system("'pkill -f 'omxplayer'")
os.system('omxplayer movie4.mov &')
sleep(1)
if GPIO.input(19):
os.system("'pkill -f 'omxplayer'")
os.system('omxplayer movie5.mov &')
sleep(1)
if GPIO.input(26):
os.system("'pkill -f 'omxplayer'")
os.system('omxplayer movie6.mov &')
sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment