esp-idf/examples/peripherals/rmt/led_strip
pedro.minatel cccdb3e4aa Get started example update for addressable LED compatibility.
Added the RMT/addr LED blink to the example and more detailed README.md
 Moved component/led_strip to common_components
 Added missing README file to common_components/led_strip
 README file update
 Makefile and Kconfig fixed for led_strip component
 Fixing end-of-line on main/blink.c
 Component updated to handle multiple instances
 Added note on the RMT channel number (ESP32 and ESP32-S2)
 Removed components folder from rmt/led_strip example and README updated
 Changed the led_strip_denit function and added ESP32-C3 RMT info on channel configuration
 Updates on README, Kconfig default settings and configure_led() function added
2021-02-15 12:34:55 +00:00
..
main rmt: refactor examples 2019-11-20 10:54:21 +08:00
CMakeLists.txt Get started example update for addressable LED compatibility. 2021-02-15 12:34:55 +00:00
Makefile Get started example update for addressable LED compatibility. 2021-02-15 12:34:55 +00:00
README.md Get started example update for addressable LED compatibility. 2021-02-15 12:34:55 +00:00

RMT Transmit Example -- LED Strip

(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.

How to Use Example

Hardware Required

  • A development board with ESP32 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
  • A USB cable for Power supply and programming
  • A WS2812 LED strip

Connection :

                             --- 5V
                              |
                              +
GPIO18 +-----------------+---|>| (WS2812)
                        DI    +
                              |
                             --- GND

Configure the Project

Open the project configuration menu (idf.py menuconfig).

In the Example Configuration menu:

  • Set the GPIO number used for transmitting the IR signal under RMT TX GPIO option.
  • Set the number of LEDs in a strip under Number of LEDS in a strip option.

Build and Flash

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.

Example Output

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.

Troubleshooting

For any technical queries, please open an [issue] (https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.