Page 1 of 1

press 1 to 6 GPIO buttons to Play a Video

Posted: Sun Feb 22, 2015 10:53 pm
by abcjake
Hey,

I am new to raspberry pi, and python. For my High School science fair project, I was hoping to be able to play informational videos. The goal was to have 6 inputs, and 6 different videos. Once a button was pressed, a video would simply play.

I've tried looking for similar source code, but have been unable to find anything simple. Any help?

Thanks

Re: press 1 to 8 GPIO buttons to Play a Video

Posted: Sun Feb 22, 2015 11:37 pm
by mahjongg
rewrote subject line to something more informative.

Re: press 1 to 6 GPIO buttons to Play a Video

Posted: Mon Feb 23, 2015 9:14 am
by elParaguayo
Have you seen Pi Presents. It may do what you're after.

Re: press 1 to 6 GPIO buttons to Play a Video

Posted: Mon Feb 23, 2015 9:20 am
by PiGraham
Agreed, check out PiPresents.

If you want to do it yourself it is simple to respond to GPIO signals in Python and play a video.

See RPi.GPIO

and

http://www.raspberrypi.org/forums/viewt ... 38&t=10599

Re: press 1 to 6 GPIO buttons to Play a Video

Posted: Mon Feb 23, 2015 10:29 pm
by abcjake
elParaguayo wrote:Have you seen Pi Presents. It may do what you're after.
Thanks, I'll give it a shot!

Re: press 1 to 6 GPIO buttons to Play a Video

Posted: Mon Feb 23, 2015 10:47 pm
by KenT
Yup, use [pipresents-next] and the radiobuttonshow

Re: press 1 to 6 GPIO buttons to Play a Video

Posted: Mon Mar 02, 2015 1:44 am
by abcjake
KenT wrote:Yup, use [pipresents-next] and the radiobuttonshow
Is there any way I can get multiple buttons to play different videos? For example; I press button 1 and it plays video 1, I press button 2 and it plays video 2. I've been reading through the manual- but I haven't found anything. Do you have any advice?

Re: press 1 to 6 GPIO buttons to Play a Video

Posted: Mon Mar 02, 2015 3:55 pm
by KenT
Its one of the more complicated shows to set up. Best to look at and modify a copy of the example.

Have a look at the pp_radiobuttonshow_1p2 example. Run it and see what it does. Then open a copy of the profile in the editor.

By editing the radiobuttonshow you will see a Links tab. This associates symbolic names to track-references of tracks in the medialist. Change the tracks in the medialist to videos making sure the replacements have a track reference that is in the Links.

You may also need to edit gpio.cfg using Leafpad as this associates the physical buttons with symbolic names.