O'Reilly logo

Raspberry Pi LED Blueprints by Agus Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Changing color through an RGB LED

The last demo of basic LED programming is to work with an RGB LED. This LED can emit monochromatic light, which could be one of the three primary colors—red, green, and blue, known as RGB.

The RGB LED connection is shown in the following figure:

Changing color through an RGB LED

In this section, we will build a simple program to display red, green, and blue colors through the RGB LED.

The following hardware components are needed:

Our hardware wiring can be implemented as follows:

  • RGB LED pin 1 is connected to Raspberry Pi GPIO18
  • RGB LED pin 2 is connected to Raspberry Pi VCC +3 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required