Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5958

Graphics, sound and multimedia • MoOde audio: GPIO button only works after setting it to pull down manually

$
0
0
I'm using a HiFiBerry DAC with MoOde Audio Player. I connected a rotary encoder with built-in rgb led and push button. The issue is with the push button, which connects to the Vin pin on the rotary encoder when it is pushed.

The problem: the button (connected to GPIO 26) only works after I manually set pin 26 to be used as pull down, by running the following Python code:

Code:

import RPi.GPIO as GPIOGPIO.setmode(GPIO.BCM)GPIO.setup(26, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
So I thought a workaround would be to run the above script in /etc/rc.local, but this doesn´t solve the problem. I checked that the script is run at startup by adding other lines of code to it.

I connected the button between 3V3 and GPIO 26 (which should be pulled down, so I connected it to the right pins... right?). I also tried other GPIO pins between 9 and 27, but the same problem persists.

Is there a file where I can check (and change) the default mode (pulled up / pulled down) all the pins have after startup? I think I need to change it there.

Statistics: Posted by ralphenstein — Sat Apr 20, 2024 1:02 pm



Viewing all articles
Browse latest Browse all 5958

Latest Images

Trending Articles



Latest Images