Skip to content

Instantly share code, notes, and snippets.

@itguy51
Created December 17, 2013 21:51
Show Gist options
  • Save itguy51/8013222 to your computer and use it in GitHub Desktop.
Save itguy51/8013222 to your computer and use it in GitHub Desktop.
bah
import RPi.GPIO as GPIO
import os
import time
from pyomxplayer import OMXPlayer
GPIO.setmode(GPIO.BCM)
GPIO.setup(22, GPIO.IN)
GPIO.setup(4, GPIO.OUT)
GPIO.output(4, GPIO.HIGH)
last = 0
omx = OMXPlayer('/home/pi/slide.mp4')
#omx.toggle_pause()
while True:
#print omx
if GPIO.input(22) != last:
os.system("killall omxplayer")
os.system("killall omxplayer.bin")
print "Changed"
os.system("omxplayer /home/pi/comp.mp4")
last = GPIO.input(22)
time.sleep(0.1)
os.system("fbset -depth 8 && fbset -depth 16")
omx = OMXPlayer('/home/pi/slide.mp4')
if os.popen("ps -A | grep omx").read().count("omxplayer") < 2:
omx = OMXPlayer('/home/pi/slide.mp4')
time.sleep(0.01)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment