PiSupply / JustBoom

Resources for JustBoom range
https://JustBoom.co
14 stars 5 forks source link

Pull down button pin #3

Open kelltob opened 7 years ago

kelltob commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

shawaj commented 7 years ago

@francesco-vannini did you see this?

shawaj commented 7 years ago

My comment above I mean

francesco-vannini commented 7 years ago

I have added this to the list of features and improvements

FedorMil commented 6 years ago

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.