Skip to content

Userscript on Button / Toggle Audio Output #1638

Answered by Thilo-90
Thilo-90 asked this question in Q&A
Discussion options

You must be logged in to vote

Good Morning,

thanks for your input @manajoe. I adjusted a bit of your code (fuction_calls.py has a small error)
I think it is almost working.

add GPIO Button
sudo nano RPi-Jukebox-RFID/settings/gpio_settings.ini

  [JackToggle]
  enabled: True
  Type: Button
  Pin: 12
  pull_up: True
  hold_time: 0.3
  functionCall: functionCallJackToggle

add function
nano RPi-Jukebox-RFID/components/gpio_control/function_calls.py

    def functionCallJackToggle(self, *args):
        function_call("{command} -c=userscript2".format(command=self.playout_control), shell=True)

add script to called function
nano RPi-Jukebox-RFID/scripts/playout_controls.sh

    userscript2)
        # will toggle audio Jack / S…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Thilo-90
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Thilo-90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants