How can I make ledsLEDs blink randomly? I
I found a piece of code, but it is not working for me.
Probably I probably need something other then setPixelthan setPixel(), but I don't know what.
I am using Fast.Led library withthe Fast.Led library with Arduino Nano and and WS2812B ledsLEDs
void loop() {
Twinkle(CRGB::Red, 10, 100, false);
}
void Twinkle(uint32_t color, uint16_t Count, uint16_t SpeedDelay, boolean OnlyOne)
{
FastLED.setBrightness(MAX_BRIGHTNESS);
fill_solid(leds, random(NUM_LEDS), CRGB::White);
FastLED.show();
for (int i=0; i < Count; i++) {
!ORIGINAL LINE OF CODE! setPixel(random(NUM_LEDS),red,green,blue);
!MY LINE! ....(random(NUM_LEDS), color);
FastLED.show();
delay(SpeedDelay);
if(OnlyOne) {
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
}
}
delay(SpeedDelay);
return;
}
void loop() {
Twinkle(CRGB::Red, 10, 100, false);
}
void Twinkle(uint32_t color, uint16_t Count, uint16_t SpeedDelay, boolean OnlyOne)
{
FastLED.setBrightness(MAX_BRIGHTNESS);
fill_solid(leds, random(NUM_LEDS), CRGB::White);
FastLED.show();
for (int i=0; i < Count; i++) {
// setPixel(random(NUM_LEDS),red,green,blue); //!ORIGINAL LINE OF CODE!
setPixel(random(NUM_LEDS), color); //!MY LINE!
FastLED.show();
delay(SpeedDelay);
if (OnlyOne) {
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
}
}
delay(SpeedDelay);
return;
}