Reassign buttons phatbeat - Pirate Radio


#1

Hello,

I would like to add (or reassign) a phatbeat button to shuffle the files in my playlist (Pirate Radio - Phat Beat using the vlc-player). For instance using the “back”-button as “shuffle”.

I noticed this file, but when I change “up” with “down” there are no changes. https://github.com/pimoroni/phat-beat/blob/76048e43a3c16d63c0a5d42e5ac550a5eb45bef7/projects/vlc-radio/phatbeatd/usr/bin/phatbeatd

Best regards,
Wilco


#2

Have a look see here and you might find the file you need to tinker with.


#3

Thanx alphanumeric for the reply, following your tips and searching around I found the partial solution in the example buttons.py supplied with phatbeat. I managed to create some sort of sleep timer by holding the on/off button for 3 seconds bij adding (./usr/bin/phatbeatd):

@phatbeat.hold(phatbeat.BTN_ONOFF, hold-time=3)
def perform_shutdown(pin):
print(“Button pressed, shutdown after 10 minutes”)
os.system(“sudo shutdown -h 10”)