-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
capacitive touch sensor ttp223 #456
Comments
Hi habersatt, If everything is wired correctly (VCC, GND and GPIO) and you didn't bridge either A or B or the ttp223's board, it should behave just as a normal button, and adjust volume in both ways: Single touch and holding. Make sure to connect the correct GPIO you take from the If that's done and you still experience trouble, feel free to post (the excerpt of) your gpio-button.py and maybe a photo of your connection. |
Hi comdoxx, |
Hi comdoxx, #!/usr/bin/python3 def def_shutdown(): def def_volU(): def def_volD(): def def_vol0(): def def_next(): def def_prev(): def def_halt(): shut = Button(3, hold_time=2) shut.when_held = def_shutdown pause() |
Hi Clemens,
Thanks for the detailed answer. I'm pretty sure, the touch sensor behaves
like a switch. Did you try to touch it on and then off after a second or
so? Does it stop then to increase or decrease volume?
Am Sa., 26. Jan. 2019, 12:24 hat habersatt <[email protected]>
geschrieben:
… Hi comdoxx,
Unfortunately, the sensor does not behave as it should. After a touch, the
volume decreases continuously to 0. If I set the volume to 100, this
process repeats itself. An ordinary push button makes everything right on
the same pin.
Since I used the sound over a pifiberry dac +, I chose the flexible
pinout. Attached now so my gpi-button.py and photos of the wiring.
Thanks and have a nice weekend
Clemens
#!/usr/bin/python3
from gpiozero import Button
from signal import pause
from subprocess import check_call
def def_shutdown():
check_call("./scripts/playout_controls.sh -c=shutdown", shell=True)
def def_volU():
check_call("./scripts/playout_controls.sh -c=volumeup", shell=True)
def def_volD():
check_call("./scripts/playout_controls.sh -c=volumedown", shell=True)
def def_vol0():
check_call("./scripts/playout_controls.sh -c=mute", shell=True)
def def_next():
check_call("./scripts/playout_controls.sh -c=playernext", shell=True)
def def_prev():
check_call("./scripts/playout_controls.sh -c=playerprev", shell=True)
def def_halt():
check_call("./scripts/playout_controls.sh -c=playerpause", shell=True)
shut = Button(3, hold_time=2)
vol0 = Button(17,pull_up=True)
volU = Button(5,pull_up=True,hold_time=0.3,hold_repeat=True)
volD = Button(6,pull_up=True,hold_time=0.3,hold_repeat=True)
next = Button(23,pull_up=True)
prev = Button(22,pull_up=True)
halt = Button(27,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
halt.when_pressed = def_halt
pause()
[image: img_4376]
<https://user-images.githubusercontent.com/47001677/51786442-ae866400-2164-11e9-8189-d11264a85a1e.jpg>
[image: img_4378]
<https://user-images.githubusercontent.com/47001677/51786443-ae866400-2164-11e9-82fc-cb6391fe3eec.jpg>
[image: img_4377]
<https://user-images.githubusercontent.com/47001677/51786441-ae866400-2164-11e9-8691-877907c944b2.jpg>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#456 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGrdgQoDXQARfIDaeL_m3l6PqDm-f4ADks5vHDrmgaJpZM4aRDNu>
.
|
Hi comdoxx! |
I had exactly the same problem! |
Hi burberius, |
Hi @habersatt |
Hello!
Instead of push buttons, I have installed capacitive touch sensors type ttp223. Everything works great except for volume up and down and mute.
My question: How do I adjust the gpio-button.py so I can adjust the volume. Maybe someone has already gained experience.
Thanks in advance.
Clemens
The text was updated successfully, but these errors were encountered: