Skip to content

sahilkhanna/esp-idf-dotstar-led-lib

Repository files navigation

ESP-IDF DOT-STAR LED Library

Tested on AWS ESP32 Lanyard made by Accumulatos for APA102-2020 type LED.

Installation

Copy "dotstar" directory under components folder and paste it in your project's components directory. Include it in your main.c file.

#include "../components/dotstar/include/dotstar.h"

Basic Usage

Call the init function to assign the correct IO pins and to setup number of LEDs.

init_led(LED_SDA,LED_CLK,TOTAL_LEDS,DOTSTAR_RGB);

Use setPixelColor() or setPixel24bitColor() to set color to individual LEDs in a strip of LEDs.

setPixelColor(led_index,r,g,b);
setPixel24bitColor(led_index, color);

Finally call the following function to display the color on LEDs.

printLED();