Hello!
I'm trying to use a WS2812B LED strip with an Arduino Nano ESP32 but it does not work at all.
After searching a little bit, here's what I found :
The pin used to send data to the LED strip doesn't output any signal (I scoped it with an oscilloscope, it stays at 0V).
I tried using both FastLED and Adafruit_NeoPixel libraries but the result was the same : no signal at all.
The same exact program works on an Arduino Uno R3 and on that one I can see a signal with the oscilloscope.
The pin and the Arduino seem to be working fine with simple circuits (analogWrite() and digitalWrite() work fine for example)
This leads me to think it's not a programming issue (since the program works on another Arduino) or a wiring issue (since the pin itself doesn't output any signal even with nothing wired to the Arduino and the Arduino plugged to my computer) but then I have no idea what the problem is
Here is the program I used for FastLED for example :
I am taking a SWAG but try changing the name for the LED_PIN, change to LEDS_PIN2 and see what happens. I cannot compile it because I do not have the board information loaded. It is possible you have a bad port.
You have a great tool, write a small loop and keep turning your LED pin on and off and with your scope see if it matches. Do this with all to be sure the rest are OK, but one at a time.
I forgot to mention I'm also getting this warning :
"No hardware SPI pins defined. All SPI access will default to bitbanged output"
Is it the same? (I'm personally not getting any other error)
But I'm not sure if that's the issue, after googling it, according to the answers I found, it would seem that it's not really a problem.
I tried doing this and I indeed see a square signal on the oscilloscope.
Therefore I'm guessing LED_PIN isn't wrong either.
(Edit: I've just tried replacing LED_PIN 2 by LED_PIN LEDS_PIN2 as you said and it does an error : "Compilation error: 'LEDS_PIN2' was not declared in this scope")
I've just noticed something. When I do pinMode(LED_PIN, OUTPUT); in setup() (like in the code I put above), the oscilloscope shows me a constant line at 3.3V (not 0 like I initially said, sorry). But when I remove it, it's 0.
That is what you would get if the pin is on or you are connecting to VCC. I am assuming the ground of the scope is also the ground of the board. After you do pinmode digitalWrite() the pin to low. If it does not go low it is either a bad pin or the wrong one. Good luck.
Hello everyone, yes - the Nano ESP32 is part of the Arduino Nano board series, and shares the same pinout for compatibility with other architectures of the series. So, unlike similar ESP32 boards, on this one Dxis notGPIOx - see the above pinout for the full details.
This is also important for the libraries that require low-level I/O and do not use the core Arduino-ESP32 framework directly, such as the ones discussed here. We are offering to help lib developers adding this support. Stay tuned!
Actually that is the same as for other ESP based boards. 'Dx' should be referenced in the sketch as 'Dx', whereas 'GPIOx' can be referenced as 'x'
The FastLED library has the option to use a different a hw Output (i think it's IR) to create the WS2812b signal.
I think Neopixelbus does not support I2S on the ESP32-S3,. From ESP32-I22.h
// ESP32C3/S3 I2S is not supported yet due to significant changes to interface
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
bit-banged output should be avoided though if possible for reasons of CPU efficiency.
Sorry for my bad wording, but I meant exactly the opposite : on this board, Dx is x, while the associated GPIO number is not used anywhere in the sketch. That is extremely common in Arduino on all platforms except the ESP32.
Let's for example consider the case of D0, which is GPIO44.
In most Arduino-ESP32 targets (boards not made by Arduino company but which are compatible with the Arduino ecosystem), the API expects a GPIO number, and the platform would have defined D0 to 44.
On the Arduino Nano ESP32 (made by Arduino), for sketch compatibility with other Arduino Nano boards, the API expects a D-number (either D0 or 0), and it will take care to convert this to GPIO44 internally.
??
This doesn't make sense with the pinout, since now do not only D2 is not referenced properly, but it is also no longer similar to any of the other ESP32 boards core.
So what does that GPIO reference actually mean in the pinout that is given within this thread ?