I' following this tutorial to have two buttons working with my Pi.
The code I have is the same:
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(23, GPIO.IN, pull_up_down = GPIO.PUD_DOWN) GPIO.setup(24, GPIO.IN, pull_up_down = GPIO.PUD_UP) while True: if(GPIO.input(23) ==1): print(“Button 1 pressed”) if(GPIO.input(24) == 0): print(“Button 2 pressed”) GPIO.cleanup()
While I don't have any response from the #23, the Pi reboots itself when I press #24.
I'm using an Adafruit Assembled Pi T-Cobbler Breakout + Cable.
What am I doing wrong?