I'm very new to electronics in general, but I want to build a small project where I can individually control (from a GPIO pin) 8 LED's. From what I understand, each GPIO pin on the Pi (Pi2 model B V1.1 in my case) sends out 3.3v?
I have a basic understanding of Ohm's law, but I don't know if I am going about this the right way. The only resistors I have are 330ohm.
All the LED's anodes are currently jumped to GPIO pins starting from 18 going to 25.
As the picture below explains, I can get 3 to work, but once I write the code for the 4th, 5th, and/or 6th LED's, nothing after the 3rd will light.
Is this even possible with my setup? Do I need to learn about how to use (and buy) transistors or something for this project? How can I get this to work?
Here is my python code:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
GPIO.setup(19, GPIO.OUT)
GPIO.setup(20, GPIO.OUT)
GPIO.setup(21, GPIO.OUT)
GPIO.output(18,1)
GPIO.output(19,1)
GPIO.output(20,1)
GPIO.output(21,1)
time.sleep(2)
GPIO.cleanup()