Hardware Play/Pause Button

Raspberry Pi related support

Hardware Play/Pause Button

Postby rlsten » 30 May 2016, 14:54

I am working on an enclosure for a Raspberry Pi 3 running Rune Audio (the latest image). Ideally, I would like to use a 3.5" touch screen, but I can't find one that works very well. The Tontec screen is resistive and touch works very erratically. So, until a better screen comes along, I was thinking of just using the screen to show what is playing and select music remotely.

I was wondering if it was possible to set up a hardware switch or button to toggle between play and pause; that is, if Rune Audio was playing, pushing the button would pause it, and if Rune Audio was paused, pushing the button would start playback. The button wouldn't have a state per se; if would simply trigger the opposite of whatever state Rune Audio was in at the moment.

If this is possible then,
1) What type of button would work - momentary or some other kind? Preferably, the button should be as small as possible.
(2) What GPIO wiring would be necessary?
and
(3) What software modifications would be necessary?

Thanks very much,
Rod
rlsten
 
Posts: 118
Joined: 25 May 2015, 18:06

Re: Hardware Play/Pause Button

Postby PeteB » 30 May 2016, 16:07

PeteB
 
Posts: 421
Joined: 06 Feb 2016, 05:07

Re: Hardware Play/Pause Button

Postby rlsten » 30 May 2016, 19:36

rlsten
 
Posts: 118
Joined: 25 May 2015, 18:06

Re: Hardware Play/Pause Button

Postby PeteB » 30 May 2016, 20:06

Last edited by PeteB on 31 May 2016, 01:23, edited 1 time in total.
PeteB
 
Posts: 421
Joined: 06 Feb 2016, 05:07

Re: Hardware Play/Pause Button

Postby PeteB » 30 May 2016, 20:42

I have only had time to prototype one momentary button, an IR sensor, and a power supply using the header pins instead of the micro-usb connector. The momentary button is assigned a function by the python script, so I can use it to test the soft-off function, play-pause, or any other single function.

Feel free to pick up where I left off... :D

Image


Image
PeteB
 
Posts: 421
Joined: 06 Feb 2016, 05:07

Re: Hardware Play/Pause Button

Postby rlsten » 30 May 2016, 22:04

rlsten
 
Posts: 118
Joined: 25 May 2015, 18:06

Re: Hardware Play/Pause Button

Postby PeteB » 30 May 2016, 22:11

PeteB
 
Posts: 421
Joined: 06 Feb 2016, 05:07

Re: Hardware Play/Pause Button

Postby rlsten » 30 May 2016, 22:46

Thanks very much, Pete.

Rod
rlsten
 
Posts: 118
Joined: 25 May 2015, 18:06

Re: Hardware Play/Pause Button

Postby rastus » 31 May 2016, 13:03

Nice work PeteB, as you may know I went for the button on the USB cable... your setup looks efficient, but too complex for me. Eeewww..... :geek:
User avatar
rastus
 
Posts: 353
Joined: 21 Aug 2015, 10:29

Re: Hardware Play/Pause Button

Postby PeteB » 31 May 2016, 13:29

PeteB
 
Posts: 421
Joined: 06 Feb 2016, 05:07

support RuneAudio Donate with PayPal

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 10 guests
cron