The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: GPIO button only works after setting it to pull down manually
#1
I have an issue where a 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 GPIO
GPIO.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.
Reply


Messages In This Thread
GPIO button only works after setting it to pull down manually - by m4th31st - 04-20-2024, 07:46 AM

Forum Jump: