ESP32 Starter Kit
7. Code Explanation
#include <NeoPixel_ESP32.h> : Libraries are included, so that codes in library can be directly recalled.
Adafruit_NeoPixel strip = Adafruit_NeoPixel(6, PIN); Define an instance strip and set the number of RGB. Here we
input 6.
PIN = 15
strip.begin(); Initialize 2812RGB
strip.setPixelColor(uint16_t n, uint8_t color); The uint16_t m is used to set the number of 2812RGB and the second
parameter is the value of the displayed color.
**strip.Color(uint8_t red , uint8_t green , uint8_t blue);**Set the color function. The value range of the three parame-
ters( red, green and blue) is (0-255). We can synthesize various colors by setting the values of the three colors.
strip.show(); Display 2812RGB
8.5.7 Project 6Water Flow Light
1. Description
This simple water flow light project enables to help you learn electronic packaging. In this project, we will control
LEDs to change the color in a specified speed via a Arduino board.
60 Chapter 8. Arduino Tutorial