How to Control a RGB LED With Raspberry Pi Pico

by caoow31 in Circuits > Raspberry Pi

641 Views, 0 Favorites, 0 Comments

How to Control a RGB LED With Raspberry Pi Pico

Photo on BE 2566-8-14 at 3.38 PM.jpg

Learn how to control a RGB LED with a Raspberry Pi Pico!

Supplies

Photo on BE 2566-8-14 at 3.41 PM.jpg
Photo on BE 2566-8-14 at 12.12 PM #3.jpg
Photo on BE 2566-8-14 at 3.41 PM #2.jpg
Photo on BE 2566-8-14 at 3.42 PM.jpg
Photo on BE 2566-8-14 at 12.12 PM #2.jpg

RGB LED

Raspberry Pi Pico

3 Jumper Wires. (Red, Green, and Blue)

2 Resistors

Attaching the RGB LED

rgb.led.gif

You may place the LED wherever on the breadboard you like, but make a mental note to remember how you plug it in. The longest leg of a RGB LED is for the ground. The second longest leg of the LED is green, which stands for the "G" in RGB. The leg to the right of the "green" leg, is blue, with is the "B" in RGB. And the final and last remaining leg is red, the "R" in RGB.

Resistor 1

Photo on BE 2566-8-14 at 3.06 PM.jpg

Put one end of the resistor down in a hole in front of Pin 36 of the Raspberry Pi Pico, also the 3V3(OUT) Pin. Stick the other end in column of holes that are closest to the red line of the breadboard.

Resistor 2

Photo on BE 2566-8-14 at 3.20 PM.jpg

For the other resistor, put one end down in the hole in front of the ground leg of the RGB LED. Then, put the other end down in a hole that is in the column closest to the red line on the breadboard.

Red Wire

Photo on BE 2566-8-14 at 3.23 PM.jpg

Jab one end of the red wire down the hole in front of the "red" leg of the LED. Then, stick the other end down the hole in front of GPIO Pin 17 on the Raspberry Pi Pico, or Pin 22.

Green Wire

Photo on BE 2566-8-14 at 3.25 PM.jpg

Push one end of the green wire down the hole in front of the "green" leg of the RGB LED. Then, stick the other end down the hole in front of GPIO Pin 16 on the Raspberry Pi Pico, or Pin 21.

Blue Wire

Photo on BE 2566-8-14 at 3.25 PM #2.jpg

Just as the same as before, stick one end of the blue wire down the hole in front of the "blue" leg of the LED, and the other end down in front of GPIO Pin 15, or Pin 20.

Code

Screen Shot 2566-08-14 at 4.14.41 PM.png

Type in this bit of code and your LED will run in a pattern of red, green, blue.

Taking It Further

Screen Shot 2566-08-14 at 12.04.30 PM.png

If you want to learn how to control more than one RGB LED, than you are more than welcome to. Just click the "Follow" button near the top and my new instructable awaits you heartwarmingly. See you soon!