Thank you for your donation!

Instruction Guide use lcdup to drive indicator LEDs
I built a headless music player for the bedroom [will post details later] and wanted to illuminate the volume dial when the player was on.  I used to control the GPIO to drive the LED.  You can also use this to indicate the status of random / repeat on the player.

here is the script I used

import RPi.GPIO as GPIO
import time;
import os;
import subprocess;

# Use SoC pin numbering
GPIO.setup(27, GPIO.OUT)

with open("/var/local/www/currentsong.txt") as file1:
    with open("/home/pi/lcd.txt", "w") as file2:
        for line in file1:

cmd1 = "mpc | head -2 | tail -1 | awk '{print $1}'"
process = subprocess.Popen(cmd1, stdout=subprocess.PIPE , shell=True)
os.waitpid(, 0)[1]
mpc_state =
if mpc_state  == "[playing]":
Nice cosmetic mod... :-)

Probably there's a better location for this 'Know How' post like << FAQ and GUIDES >> section... there's a much larger audience in that section for all kinds of mods and configurations.

Forum Jump: