Skip to content
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

Pull down button pin #3

Open
kelltob opened this issue May 31, 2017 · 6 comments
Open

Pull down button pin #3

kelltob opened this issue May 31, 2017 · 6 comments

Comments

@kelltob
Copy link

kelltob commented May 31, 2017

I got the volume control working with my new rotary encoder. Is there any way to use my button pin pulled down?
I want to use the RGB LED of my rotary but if I do so, the button has to be connected to 3.3V and the button pin.
That's the circuit diagram of the rotary.
image
It also would be nice if the script changes the volume based on the current alsa level
(If I set volume in alsamixer or via volumio and afterwards via rotary it jumps back to the former volume)

@francesco-vannini
Copy link
Contributor

For the button to work as pull down try changing these lines in the rotary class
GPIO.setup(buttonPin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) # will be connected to VCC

and
def _switchCallback(self, pin):
if GPIO.input(self.buttonPin) == 1:
self.buttonCallback()

also you will need to connect one of your button pins to VCC instead of GND. Remember to use a resistor in series.

As for the volume between ALSA and Volumio I am aware of that problem but don't currently know how to solve it, sorry.

@shawaj
Copy link
Member

shawaj commented Jun 4, 2017

@francesco-vannini - maybe something we should mention to Volumio as we're developing the rotary encoder and remote control plugins?

@kelltob kelltob closed this as completed Jun 6, 2017
@shawaj
Copy link
Member

shawaj commented Jun 7, 2017

@francesco-vannini did you see this?

@shawaj
Copy link
Member

shawaj commented Jun 7, 2017

My comment above I mean

@francesco-vannini
Copy link
Contributor

I have added this to the list of features and improvements

@FedorMil
Copy link

FedorMil commented Apr 9, 2018

Good day. Yesterday installed the plugin justboom rotary encoder. I would like to add a function to disable the button, when pressed for a long time. I saw it in iqaudio's cosmiccontroller, but could not implement it in your script. Displays a syntax error. Can you help me? And one more thing, I also do not work with the alsamixer. Thank you for attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants