yiqi77
August 14, 2024, 4:29pm
1
#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?
xfpd
August 14, 2024, 7:18pm
2
Your code says 12 LEDs...
yiqi77:
#define LED_COUNT 12
You say 24.
yiqi77:
NeoPixel Ring - 24
Brightness of 50 should be enough to see, but you should try one LED at 255 for a test.
yiqi77:
strip.setBrightness(50);
Verify your Data Pin 6 is going to DIN of the Neopixel through a 330 ohm resistor.
Your code works... check your connections.
yiqi77
August 14, 2024, 8:31pm
3
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
}
xfpd
August 14, 2024, 10:22pm
4
From where is your power coming? Please, post a wiring diagram.
Wawa
August 22, 2024, 4:40am
5
Addressable LEDs are 5volt-only.
Your processor is using 3.3volt logic.
How did you solve that problem.
Leo..
system
Closed
February 18, 2025, 4:40am
6
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.