From the course: Learning Arduino: Pulse Width Modulation
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Using an RGB LED - Arduino Tutorial
From the course: Learning Arduino: Pulse Width Modulation
Using an RGB LED
- Color mixing is a great use of PWM. By turning on various colored LEDs at different intensities, I can create any color in the rainbow. This is how your computer creates colors on a monitor. An RGB LED is a special type of LED that combines three LEDs into one. RGB stands for red, green, blue, and is a way of mixing light to create colors. This is called an additive color system. In this system, the absence of color, or light, is black. By turning on each of the three colors at different brightness, you can create any color in the color wheel. Mixing these three colors at full strength creates white light. RGB LEDs have four leads. There are two common ways that those four leads will be set up. These configurations are referred to as "Common Cathode" or "Common Anode". A common cathode RGB LED has one anode lead for each LED. The three colors share a single cathode, or ground. This is the easiest configuration to work with on the Arduino. Simply hook each anode up to a PWM pin, and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Fading an LED with PWM with code3m 5s
-
(Locked)
Calibrating an analog input to fade an LED precisely3m 35s
-
(Locked)
Challenge: Programming an LED that reacts to brightness54s
-
(Locked)
Solution: Programming an LED that reacts to brightness2m 45s
-
(Locked)
Using an RGB LED3m 49s
-
(Locked)
Mixing colors on an RGB LED using three analog inputs1m 43s
-
(Locked)
Challenge: Fading through the rainbow with PWM51s
-
(Locked)
Solution: Fading through the rainbow with PWM2m 21s
-
-
-