I'm a rookie with Raspberry Pi and electronics in general. I was able to get my LED to turn on when I plug it into the breadboard but i'm unable to get it to respond via Python or wiringPi. The LED currently turns on as soon as there is power to the Pi.
With wiringPi i've tried this and nothing happens:
$ gpio -g mode 4 out $ gpio -g write 4 0 $ gpio -g write 4 1
I've also tried running this code with python via
$ sudo python test.py
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(4,GPIO.OUT) print "LED on" GPIO.output(4,GPIO.HIGH) time.sleep(1) print "LED off" GPIO.output(4,GPIO.LOW)
Any idea's on what i'm doing wrong and why I can't get software to talk to my LED?
I tried switching the ribbon the other way on my Pi so here's some updated pictures. With the updated pictures i've tried this via the command line:
$ gpio -g mode 21 out $ gpio -g write 21 0 $ gpio -g write 21 1