MOCKSTACKS
EN
Questions And Answers

More Tutorials









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?


Conclusion

In this page (written and validated by ) you learned about Raspberry RGB LED ws2813 mini . What's Next? If you are interested in completing Raspberry tutorial, your next topic will be learning about: Raspberry List and Tuple.



Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue: mockstacks@gmail.com.


Share On:


Mockstacks was launched to help beginners learn programming languages; the site is optimized with no Ads as, Ads might slow down the performance. We also don't track any personal information; we also don't collect any kind of data unless the user provided us a corrected information. Almost all examples have been tested. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. By using Mockstacks.com, you agree to have read and accepted our terms of use, cookies and privacy policy.