Raspberry RGB LED ws2813 mini
In this lesson, we will use the RGB LED (ws2813 mini) instead of a simple LED, which can be programmed for a full-color display and different light effects.
When we set RGB LED to display different colors, we only need to set the values of red (R), green (g), and blue (b) respectively. The red, green and blue color channels are divided into 256 levels of brightness, that is, 0-255. The value of 0 is the least bright, which is synonymous with turning off the light, while the most bright at the value of 255. The common color values are listed below:
1 BLACK = (0, 0, 0)
2 RED = (255, 0, 0)
3 YELLOW = (255, 150, 0)
4 GREEN = (0, 255, 0)
5 CYAN = (0, 255, 255)
6 BLUE = (0, 0, 255)
7 PURPLE = (180, 0, 255)
8 WHITE = (255, 255, 255)
Above, we defined tuples for different colors to store corresponding color data. A new data type is introduced here — tuple. Do you know what it is and how to use it?