Hi,
First time poster, Arduino beginner.
In a circuit connecting a string of twenty (20) WS2812 RGB LEDs to a "Kuman" Arduino Uno R3 clone, all of the LEDs light up for 2 or 3 seconds after power is first supplied to the Arduino.
Is there a way to keep all LEDs off until the sketch main loop starts running?
It's not a showstopper if I can't suppress the LEDs at boot, but I'm concerned the initial ~250mA power draw will eventually burn out the Arduino.
At power up, I measured about 248 mA drawn on the LED circuit with all 20 LEDs lit up.
Power drops to about 43 mA once the sketch runs with only two LEDs lit, a blue LED "chasing" a red LED around the string.
"Data In" on the first LED is connected to pin 6 on the Arduino (with a 470R resistor in series as recommended by Adafruit).
Power and Ground are connected to the +5V and Ground pins of the Arduino.
The LEDs illuminate at start up whether power is supplied by the USB port or by the 5.5mm power connector. I have tried both a 9V battery and a 9V wall wart power adapter.
I also tried the suggestion in this post regarding a similar problem with a servo motor receiving power when the Arduino initializes, to put a 10K pull down resistor on the output pin, but all LEDs still light up at power on:
Finally, I get the same result with this circuit and sketch on an Elegoo Arduino Uno R3 clone, so I don't think the problem is particular to the Kuman clone.
Any suggestions are more than welcome!
#include <FastLED.h>
#define NUM_LEDS 20
#define DATA_PIN 6
CRGB leds[NUM_LEDS];
void setup()
{
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
FastLED.setBrightness(64);
}
void loop()
{
// Did not work
//FastLED.clear();
// Cycle through the string of LEDs
for (int i = 0; i < NUM_LEDS; i++)
{
// Set LED i to blue
leds[i] = CRGB::Blue;
// Set the LED following the blue LED to red
leds[(i + 1) % NUM_LEDS] = CRGB::Red;
// display the blue and red LEDs
FastLED.show();
// Clear both LEDS
leds[i % NUM_LEDS] = CRGB::Black;
leds[(i + 1) % NUM_LEDS] = CRGB::Black;
// wait half a second
delay(500);
}
}
