I connected an RGB LED(common anode) via the GPIO, and tried to get it to light up, but for some reason when I run the command, the LED does not light up. Here's the code I'm using
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(11, GPIO.OUT) GPIO.output(11,1) GPIO.setup(13, GPIO.OUT) GPIO.output(13,1) GPIO.setup(15, GPIO.OUT) GPIO.output(15,1) try: while(True): request = raw_input("RGB:") if(len(request) == 3): GPIO.output(11, int(request)) GPIO.output(13, int(request)) GPIO.output(15, int(request)) except KeyboardInterrupt: GPIO.cleanup()
And this is what my setup looks like
Any ideas what I'm doing wrong? It's my first week working with my Raspberry Pi.