Software guy here, first time doing hardware.
Here is my breadboard setup (yellow is GPIO-8, green is ground):
Here is my Python:
import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BCM) button = 8 GPIO.setup(button, GPIO.IN, pull_up_down=GPIO.PUD_UP) try: while True: output = GPIO.input(button) print(output) sleep(.2) finally: GPIO.cleanup() print('cleaned')
1 ... etc...
When I press the button, it doesn't change to
0. But, the LED turns on, which tells me that the circuit is working. Why isn't it triggering the 0 on the script?