Hi, I am looking for an esp32 library that should work on the I2S peripheral for the WS2812 RGB LED. I have tried the library with RMT peripheral but it flickers a lot. I have tried this library https://github.com/vunam/esp32-i2s-ws2812 which works on I2s peripheral but it can only drive 12 LEDs and I don't know to modify it for use 24 led. I there any library which satisfies the following things.
-written in C
-works on I2s or SPI
-don't flicker
-support 24 led
please help with this.
ESP32 idf library (using i2s or SPI) for ws2812.[Solved]
-
- Posts: 4
- Joined: Fri Feb 16, 2018 5:45 am
ESP32 idf library (using i2s or SPI) for ws2812.[Solved]
Last edited by khairnardm on Thu Nov 05, 2020 4:50 pm, edited 1 time in total.
-
- Posts: 9713
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32 idf library (using i2s or SPI) for ws2812.
Where do you get that it only supports 12 LEDs? As far as I can tell, the default setting is 8, and you can change that by changing the line '#define LED_NUMBER 8' in ws2812.h.
-
- Posts: 4
- Joined: Fri Feb 16, 2018 5:45 am
Re: ESP32 idf library (using i2s or SPI) for ws2812.
I have changed that to #define LED_NUMBER 12 and it can control 12 LEDs. But is it possible to control 24 LEDs? I can't find any other library like this. I need just two functions initLED() and setColor().
-
- Posts: 9713
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32 idf library (using i2s or SPI) for ws2812.
...why would it not be? Have you tried?
-
- Posts: 4
- Joined: Fri Feb 16, 2018 5:45 am
Re: ESP32 idf library (using i2s or SPI) for ws2812.
Ok, I found one code for I2S ws2812 which is for Arduino and in CPP. so I ported this code of IDF in C. and it is working fine but got another problem. when there is some BLE operation going its flickers some led. here is the code https://github.com/8-DK/ESP32_I2S_WS2812_idf.
I have also added this code to git https://github.com/8-DK/ESP32_SPI_WS2812_idf. this used SPI and DMA buffer to send ws2812 bit data. This is the flicker-free solution.
I have also added this code to git https://github.com/8-DK/ESP32_SPI_WS2812_idf. this used SPI and DMA buffer to send ws2812 bit data. This is the flicker-free solution.
Who is online
Users browsing this forum: No registered users and 77 guests