![header-lesson-04](assets/header-lesson-04.png)

# Lesson 4: RGB LEDs

In this lesson, 

## What is an RGB LED?

An RGB LED is a special type of light that can change colors. It has three tiny LEDs inside: one red, one green, and one blue. By adjusting how bright each of these tiny LEDs is, an RGB LED can create almost any color you can imagine. For example, if you mix red and green light, you get yellow; if you mix all three colors at full brightness, you get white. 

![rgb-led](assets/rgb-led.jpeg)

RGB LEDs have four leads instead of two leads, like the LEDs in the previous lesson. There are two common RGB LEDs, **common anode** RGB LEDs and **common cathode** RGB LEDs.

![rgb-led-types](assets/rgb-led-types.png)

The difference between common anode and common cathode RGB LEDs is how they are wired to allow the colors to mix. In a common anode RGB LED, all three LED colors (red, green, and blue) share a common positive connection (anode), and you control each color by connecting the negative side (cathode) of each LED to ground. In a common cathode RGB LED, all three colors share a common negative connection (cathode), and you control each color by connecting the positive side (anode) of each LED to power. This wiring difference affects how you connect the LED to your circuit and control the colors, but both types can create the same wide range of colors.

A common cathode RGB LED has all the negative connections (cathodes) of the red, green, and blue LEDs joined together, while a common anode RGB LED has all the positive connections (anodes) joined together. In a common cathode LED, you control the colors by connecting the positive side of the circuit to each color, while in a common anode LED, you control the colors by connecting the negative side.

For beginners, a common cathode RGB LED is usually easier to use because it’s simpler to connect the negative side to ground and control each color by turning on the positive voltage for each color.