RGB LED

Learn how to use Sparki's RGB LED

SparkiDuino
Easy

Lessons You Should Know

Sparki has an RGB (Red, Green, Blue) LED light. It is used to display any color, useful for showing simple information. Top - RGB LED

How It Works

By combining the colors red, green and blue you can make any color you want:

500px-RGB_color_wheel_10

To use this idea, the part has a tiny red, green and blue LED light closely placed together. By adjusting the intensity of each of these LED lights, it is possible to create any color.

Using the Part

With the basic Sparki code in place, you can change the RGB LED color using this command: Where red, green and blue are numbers from 0 to 100. For example, if you wanted the light to be red-only, you would use: You can also use the name of a color (as long as it’s all capital letters) to display it. So for the above example of red, you would use: Sparki’s code comes with the following predefined colors: SparkiDuino already has code examples for you to use: File->Examples->Sparki->RGB