Week 3: raspberry PI Driving RGB LED

Introduction: You know what’s even more fun than a blinking LED? Changing colors with one LED. RGB, or red-green-blue, LEDs have three different color-emitting diodes that can be combined to create all sorts of colors. In this circuit, you’ll learn how to use an RGB LED to create unique color combinations. Depending on how bright each diode is, nearly any color is possible!
Parts Needed:
You will need the following parts:
⦁ 1x Breadboard
⦁ 1x Raspberry Pi 3
⦁ 1x LED – RGB Common Cathode
⦁ 3x 330 Ω or 220 Ω Resistors
⦁ 5x Jumper Wires


Important Information:
To figure out which pin is which colour, pick up the RGB so that the longest Pin (Ground) is aligned to the left like in the picture. The pins from Left to Right are Red, Ground, Green and Blue.

Circuit Diagram:
Connect the Red Pin of the LED to GPIO 2, Blue pin to GPIO 3 and Green pin to GPIO 4. Don’t forget the resistors in between. See last page for pin locations. (Red Wires).
Connect the ground pin on the LED to Ground on the Breadboard. Then connect ground on the Breadboard to ground on the Raspberry PI. (Blue Wires).


Programming Code:


What should you see:
You should see your LED turn on, but this time in new, crazy colors! If it isn’t, make sure you have assembled the circuit correctly and verified and uploaded the code to your board or see the troubleshooting section.