I'm trying to get started with GPIO, but I just can't get this LED to flash on and off, for some reason.
I'm using Raspbian on an old model B Pi with a 26 pin breakout board and a breadboard. The wiring is fine, the LED turns on but nothing happens when I run the code, it just stays on solid. I have a photo of the wired breadboard as well as the code. The LED IS lit, a bit hard to see as the pic was taken with a flash so you can see detail better. To be clear, the led does light up when the Pi is on.
import RPi.GPIO as GPIO import time pinNum = 8 GPIO.setmode(GPIO.BCM) #numbering scheme that corresponds to breakout board and pin layout GPIO.setup(pinNum,GPIO.OUT) #replace pinNum with whatever pin you used, this sets up that pin as an output #set LED to flash forever while True: GPIO.output(pinNum,GPIO.HIGH) time.sleep(0.5) GPIO.output(pinNum,GPIO.LOW) time.sleep(0.5)