|
|
5 лет назад | |
|---|---|---|
| .. | ||
| main | 6 лет назад | |
| CMakeLists.txt | 4 лет назад | |
| Makefile | 4 лет назад | |
| README.md | 4 лет назад | |
(See the README.md file in the upper level 'examples' directory for more information about examples.)
Although RMT peripheral is mainly designed for infrared remote applications, it can also support other generic protocols thanks to its flexible data format. WS2812 is a digital RGB LED which integrates a driver circuit and a single control wire. The protocol data format defined in WS2812 is compatible to that in RMT peripheral. This example will illustrate how to drive an WS2812 LED strip based on the RMT driver.
Connection :
--- 5V
|
+
GPIO18 +-----------------+---|>| (WS2812)
DI +
|
--- GND
Open the project configuration menu (idf.py menuconfig).
In the Example Configuration menu:
RMT TX GPIO option.Number of LEDS in a strip option.Run idf.py -p PORT flash monitor to build, flash and monitor the project.
(To exit the serial monitor, type Ctrl-].)
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
Connect the DI signal of WS2812 LED strip to the GPIO you set in menuconfig.
Run the example, you will see a rainbow chasing demonstration effect. To change the chasing speed, you can update the EXAMPLE_CHASE_SPEED_MS value in led_strip_main.c file.
For any technical queries, please open an issue on GitHub. We will get back to you soon.