Question about the Arduino GIGA R1 code for LED


#include <Adafruit_NeoPixel.h>
#define LED_PIN    6
#define LED_COUNT 12

Adafruit_NeoPixel strip(LED_COUNT,LED_PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin(); 
  strip.setBrightness(50);
  for(int i = 0; i <LED_COUNT ; i++) {
  strip.setPixelColor(i, strip.Color(255, 255, 255));}           
  strip.show();
  delay(1000);
}

void loop() {
 
}

I wrote the above code to make the NeoPixel Ring - 24 x 5050 RGB LED with Integrated Drivers on the Arduino board to light up white, but the code does not light up the LED. How should I modify it?

Your code says 12 LEDs...

You say 24.

Brightness of 50 should be enough to see, but you should try one LED at 255 for a test.

Verify your Data Pin 6 is going to DIN of the Neopixel through a 330 ohm resistor.

Your code works... check your connections.

Thanks for your reply, I am using a 12" ring light. I tested the voltage with DC and it is 3.7V.The following code can light up six lights one after another, but it is not stable. The code in question cannot light up at all.
#include <Adafruit_NeoPixel.h>

#define LED_PIN 6
#define LED_COUNT 12

Adafruit_NeoPixel ring(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);

void setup() {
pinMode(6, OUTPUT); // Set pin 6 as an output pin
digitalWrite(6, HIGH); // Set pin 6 to a high level (5V)

for(int i = 0; i <LED_COUNT ; i++) {
ring.setPixelColor(i, ring.Color(255, 255, 255));
}
ring.show();
}

void loop() {
// Keep pin 6 at a high level, no other operations
}

From where is your power coming? Please, post a wiring diagram.

Addressable LEDs are 5volt-only.
Your processor is using 3.3volt logic.
How did you solve that problem.
Leo..

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.