I am trying to make a LED blink on a Raspberry Pi Breadboard, but after everything I've tried, it doesn't work.
I have tried:
Changing wires and moving them around
Switching LED's to check if the current one is faulty (It's not)
Flipping the ribbon cable the other way (The original setup was correct, so I changed it back)
Following the manual provided by SunFounder ( I got my kit from SunFounder)
Copy pasting exact code from manuals
Following the exact layout from tutorials and pasting the exact code
Using different resistors to check if the current one was faulty (It wasn't, again)
Using different Jumper Cables
Using RPi.GPIO and gpiozero (made no difference- still didn't work.)
Flipping the LED around from positive and negative
Sources I've used:
https://www.woolseyworkshop.com/2018/06/20/blink-making-an-led-blink-on-a-raspberry-pi/
Can't get my LED to flash
I used code from the links above.
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)
and for gpiozero:
import gpiozero as gpio
led = gpio.LED(17)
while True:
led.blink()
and
import gpiozero as gpio
led = gpio.LED(11)
while True:
led.blink()
My first attempt looked like ( I tried powering the LED via 3.3v ) :
import gpiozero as gpio
led = gpio.LED(1)
while True:
led.blink()
I did the same for RPi.GPIO.
EDIT: I can't post wiring as I don't have a camera( I have a pc with no camera )
But, I do have the basic schematic I followed in the exact way
I'm still confused, though.
If the power is from the first 3.3V pin but the other wire is at GPIO17, should I use led = LED(1)
or led = LED(17)
or led = LED(11)
?