-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The onboard Neopixel led does not work on every ESP32-xx board. #861
Comments
Note: for ESP32-S3, this works if we replace |
Okay, I found the source of the confusion:
Wokwi implements the newer version, v1.1. The arduino core seems to target the older version, using pin 48. |
For C6/H2, I looked at the logic analyzer, and it seems like the RMT peripheral clock is off by about a factor of two. Investigating. |
Issue found, working on a fix. |
Fix is up! |
This is in fact not necessary, as the RMT unit is used for neopixelWrite. Also |
For the S3: see my comment above |
Looking at the code for the Arduino core, pin number 48 is hard coded. The ESP32-S3-DevKitM-1, which is a different board, also uses 48. IMHO we should keep 38, as it's compatible with the latest version of the ESP32-S3-DevKitC-1, and the official documentation says the LED should be on pin 38. |
For the user experience: As a (Wokwi) user, I would expect Unfortunately, neither the DevKitM-1 nor the specific version of the DevKitC-1 can be selected in Wokwi. |
I hear you. Let's ping Espressif to get their opinion about this. |
This is the code from // Verify if the pin used is RGB_BUILTIN and fix GPIO number
#ifdef RGB_BUILTIN
pin = pin == RGB_BUILTIN ? pin - SOC_GPIO_PIN_COUNT : pin;
#endif If the actual WS2812 pin is |
if |
There is a discussion on the Discord channel about the Neopixel led on the ESP32-xx boards.
Espressif provides a function for the onboard Neopixel led when Arduino code is used, but also a common Neopixel library can be used.
The led works in real life, but not for every board in Wokwi.
The function neopixelWrite(): https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-rgb-led.h
Test code:
Result:
ESP32-S2 : works
ESP32-S3 : does not work
ESP32-C3 : works
ESP32-C6 : does not work
ESP32-H2 : does not work
[EDIT] Setting the pinMode for the pin for the Neopixel was removed from setup(), according to the explanation by sivar2311 below.
The text was updated successfully, but these errors were encountered: