7. Code Explanation
1. Set the number of 2812 RGB. A development board pin can control multiple 2812 RGB LEDs, so we need to set
the number in advance and select the connected pin.
2. Set the brightness of 2812 RGB. Input the brightness value within 0-255, in which 255 is the brightest.
3. This block will turn off all 2812 RGBs.
4. Control the display of 2812 RGBs. We can fill the blanks to control the lighting LED and its color after selecting
the pin. For instance, "0 to 0" means only the first LED lights up. After uploading the code, the first LED will
turn on in the set color.
NOTE: The two blanks also can be filled with variables, so that a light show is able to be formed.
5. Set the color of 2812 RGBs. The displayed color can be modulated by the value in red, green and blue. We can
add this block in the color settings of 2812 RGB.
6. It can control a single 2812 RGB display via enter the control led number and select the color.
7. The 2812 RGB will display the set color only after refreshing
9.2. Scratch Project
ESP32 Starter Kit
193
Need help?
Do you have a question about the ESP32 and is the answer not in the manual?
Questions and answers