Skip to content

Commit

Permalink
make GPIO selection compatible with directly via I2S connected DACs
Browse files Browse the repository at this point in the history
disable GPIOs which functions are covered by rotary encoders
  • Loading branch information
Martin Clausen authored and Martin Clausen committed Nov 25, 2018
1 parent ac97c26 commit e03e4c7
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions misc/sampleconfigs/gpio-buttons.py.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ from gpiozero import Button
from signal import pause
from subprocess import check_call

# 2018-10-31
# Added the function on holding volume + - buttons to change the volume in 0.3s interval
#
# 2018-10-15
# this script has the `pull_up=True` for all pins. See the following link for additional info:
# https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/259#issuecomment-430007446
Expand Down Expand Up @@ -38,23 +35,19 @@ def def_halt():
check_call("./scripts/playout_controls.sh -c=playerpause", shell=True)

shut = Button(3, hold_time=2)
vol0 = Button(13,pull_up=True)
volU = Button(16,pull_up=True,hold_time=0.3,hold_repeat=True)
volD = Button(19,pull_up=True,hold_time=0.3,hold_repeat=True)
next = Button(26,pull_up=True)
prev = Button(20,pull_up=True)
halt = Button(21,pull_up=True)
#vol0 = Button(13,pull_up=True)
#volU = Button(16,pull_up=True)
#volD = Button(19,pull_up=True)
#next = Button(26,pull_up=True)
#prev = Button(20,pull_up=True)
halt = Button(24,pull_up=True)

shut.when_held = def_shutdown
vol0.when_pressed = def_vol0
volU.when_pressed = def_volU
#When the Volume Up button was held for more than 0.3 seconds every 0.3 seconds he will call a ra$
volU.when_held = def_volU
volD.when_pressed = def_volD
#When the Volume Down button was held for more than 0.3 seconds every 0.3 seconds he will lower t$
volD.when_held = def_volD
next.when_pressed = def_next
prev.when_pressed = def_prev
#vol0.when_pressed = def_vol0
#volU.when_pressed = def_volU
#volD.when_pressed = def_volD
#next.when_pressed = def_next
#prev.when_pressed = def_prev
halt.when_pressed = def_halt

pause()

0 comments on commit e03e4c7

Please sign in to comment.