Hello to everyone!
Today I turned on a ESP32-S2 for the first time. First thing I've seen was the RGB LED that was changing color (red, blue and then green).
Now I'd like to use it.
The problem: it uses pin GPIO18. Only one pin. Indeed I discovered it is an addressable RGB LED (WS2812) and it uses a particular protocol.
I didn't find anything to drive this LED. There is this website of Espressif https://docs.espressif.com/projects/esp ... /ledc.html but it doesn't help me because I need an example to know how to configure the various functions.
On the other hand I've seen some official examples, but I don't know if they cover this case.
Anyone has been able to make the RGB LED work?
[SOLVED] ESP32-S2 Saola how turn on built-in RGB LED
[SOLVED] ESP32-S2 Saola how turn on built-in RGB LED
Last edited by filo_gr on Tue Sep 21, 2021 7:23 am, edited 1 time in total.
Filippo
Re: ESP32-S2 Saola how turn on built-in RGB LED
Hello @filo_gr
have a look at the blink example. It also covers the RGB LED on the ESP32-S2 Saola board.
https://github.com/espressif/esp-idf/tr ... rted/blink
Thanks
Felix
have a look at the blink example. It also covers the RGB LED on the ESP32-S2 Saola board.
https://github.com/espressif/esp-idf/tr ... rted/blink
Thanks
Felix
Re: ESP32-S2 Saola how turn on built-in RGB LED
Hi, thank you for you quick answer.
I tried the example but I obtain an error when build the project.
There is the #include "led_strip.h" that gives me an error (no such file or directory).
In fact I don't have this library! I searched for it inside my esp-idf folder. I found it however the functions in the example (such as led_strip_init) aren't declared in this header file!
I'm struggling to find a solution.
I tried the example but I obtain an error when build the project.
There is the #include "led_strip.h" that gives me an error (no such file or directory).
In fact I don't have this library! I searched for it inside my esp-idf folder. I found it however the functions in the example (such as led_strip_init) aren't declared in this header file!
I'm struggling to find a solution.
Filippo
Re: ESP32-S2 Saola how turn on built-in RGB LED
Hello @filo_gr
this particular include file is here: https://github.com/espressif/esp-idf/tr ... ip/include
Thanks
Felix
this particular include file is here: https://github.com/espressif/esp-idf/tr ... ip/include
Thanks
Felix
Re: ESP32-S2 Saola how turn on built-in RGB LED
Dear @felmue,
Thanks a lot.
Unfortunately my issue is born from the fact I use VS Code, I'm not an expert user and I wasn't able to include the led_strip.h correctly (I'm still struggling to understand how to set .json)...
However I put all the code of led_strip_rmt_ws2812.c inside the blink code.. and now it works!
Beyond this fact, I ask another thing: I noticed on this page https://esp-idf-lib.readthedocs.io/en/l ... strip.html that this library may cause problems to WiFi.
Anyone has experienced problems? What kind of solution is available?
Thanks a lot.
Unfortunately my issue is born from the fact I use VS Code, I'm not an expert user and I wasn't able to include the led_strip.h correctly (I'm still struggling to understand how to set .json)...
However I put all the code of led_strip_rmt_ws2812.c inside the blink code.. and now it works!
Beyond this fact, I ask another thing: I noticed on this page https://esp-idf-lib.readthedocs.io/en/l ... strip.html that this library may cause problems to WiFi.
Anyone has experienced problems? What kind of solution is available?
Filippo
Re: ESP32-S2 Saola how turn on built-in RGB LED
For anyone who experienced the same problem including a library with Visual Studio Code:
I put the line "compileCommands": "${workspaceFolder}/build/compile_commands.json" in the file c_cpp_properties.json
Then the path to the library in the following way (inside the CMakeLists.txt):
idf_component_register(SRCS "name of project.c" "#path to library/led_strip/include/led_strip.c" INCLUDE_DIRS ".")
Finally I can include the library in my code, inserting the path to the header file:
#include "#path to library/led_strip/include/led_strip.h"
After that I full compile the project, but before doing this I delete the build folder if errors occur.
Now I write that the problem is solved, however the following question remains open:
In the following page https://esp-idf-lib.readthedocs.io/en/l ... strip.html it says that
I put the line "compileCommands": "${workspaceFolder}/build/compile_commands.json" in the file c_cpp_properties.json
Then the path to the library in the following way (inside the CMakeLists.txt):
idf_component_register(SRCS "name of project.c" "#path to library/led_strip/include/led_strip.c" INCLUDE_DIRS ".")
Finally I can include the library in my code, inserting the path to the header file:
#include "#path to library/led_strip/include/led_strip.h"
After that I full compile the project, but before doing this I delete the build folder if errors occur.
Now I write that the problem is solved, however the following question remains open:
In the following page https://esp-idf-lib.readthedocs.io/en/l ... strip.html it says that
What does it mean exactly?If you try to use this driver simultaneously with Wi-Fi, you may encounter RMT transmission bugs. To avoid them, simply initialize device from the task bound to the second processor core.
Filippo
Who is online
Users browsing this forum: Bing [Bot], HitecSmartHome and 281 guests