Nano 32 with single WS2812 LED not working

Hi, I have a very simple problem.
I am connecting WS2812 RGB LED to Arduino nano 32, but I can't make it work. Please see attached photos and let me know what I am doing wrong.
I am connecting LED to external power supply 5V, GND to Arduino and external power, data signal D3 to resistor 330 to led data pin DI.

type or paste code here
/// @file    Blink.ino
/// @brief   Blink the first LED of an LED strip
/// @example Blink.ino
#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 1
// For led chips like WS2812, which have a data line, ground, and power, you just
#define DATA_PIN 3
//#define CLOCK_PIN 13
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() { 
    // Uncomment/edit one of the following lines for your leds arrangement.
    // ## Clockless types ##
    FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);  // GRB ordering is assumed

    FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);  // GRB ordering is typical
}
void loop() { 
  // Turn the LED on, then pause
  leds[0] = CRGB::Red;
  FastLED.show();
  delay(500);
  // Now turn the LED off, then pause
  leds[0] = CRGB::Black;
  FastLED.show();
  delay(500);
}

If you have only one led, why did you defined it twice?

1 Like

I removed the second line, and I found the solution

LED strip libraries not working with Arduino Nano ESP32.

I changed pins 2 to 5 in the sketch while connecting the data pin to D2 on the board.

I moved your topic to an appropriate forum category @carlosm2000.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

1 Like

Thank you for reply.