Controlling an LED by play state

Raspberry Pi related support

Controlling an LED by play state

Postby littledogie » 11 Jun 2017, 00:37

I'm sure the answer is already here in the forums, but I am so new to this all that I don't know how to ask the question to find answers. I am working on mounting my Raspberry Pi with Hifiberry DAC+ into the body of an old flip-style clock radio. My goal is to replace the light behind the frequency display with an LED tied into the GPIO that turns on when RuneAudio is playing.

The DAC+ already has a light that does this, but I'm not sure if that function can be "redirected" to a GPIO pin. There's probably an easy way to use a Python script to detect RuneAudio's play state and use that variable to set the LED status... I'd welcome any help directing me to the best place to read up on how.

Thanks!
RuneAudio release version: 0.3 (build: beta-20160313)
Raspberry Pi 3B
Hifiberry DAC+
littledogie
 
Posts: 7
Joined: 05 Aug 2016, 23:09

Re: Controlling an LED by play state

Postby littledogie » 19 Sep 2017, 02:19

littledogie
 
Posts: 7
Joined: 05 Aug 2016, 23:09

Re: Controlling an LED by play state

Postby ianhaynes » 19 Sep 2017, 09:35

Pi 2, Ver. 0.5b, IQAudio DAC+
ianhaynes
 
Posts: 207
Joined: 04 Mar 2015, 12:51

Re: Controlling an LED by play state

Postby hondagx35 » 19 Sep 2017, 16:07

User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Controlling an LED by play state

Postby littledogie » 19 Sep 2017, 19:14

Thanks Frank! I must have been mixed up since both python-mpd2 and python2-mpd exist...

I'll give it a test tonight and see how it goes.

(BTW - I assumed there would be errors in my script --- I'm looking forward to code errors instead of complete failures to launch... :) )
littledogie
 
Posts: 7
Joined: 05 Aug 2016, 23:09

Re: Controlling an LED by play state

Postby hondagx35 » 19 Sep 2017, 20:28

User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Controlling an LED by play state

Postby littledogie » 20 Sep 2017, 02:51

Frank - you're a scholar and a gentleman. I got python-mpd2 working, and am now happily generating terrible code that doesn't work - but it's not working for the right reasons, and I can proceed to learn from my mistakes. Thanks again for your help - there is an LED glow at the end of this tunnel ;)
littledogie
 
Posts: 7
Joined: 05 Aug 2016, 23:09

Re: Controlling an LED by play state

Postby littledogie » 25 Sep 2017, 13:56

littledogie
 
Posts: 7
Joined: 05 Aug 2016, 23:09

Re: Controlling an LED by play state

Postby Tall Person » 06 Nov 2017, 03:08

-Raspberry Pi B rev 2, Hifiberry DAC
-Raspberry Pi Zero W, Hifiberry DAC, Runeaudio 0.4
Tall Person
 
Posts: 16
Joined: 16 Sep 2017, 19:43

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 30 guests