user8162: How can I make LEDs blink randomly?
I found a piece of code, but it is not working for me. I probably need something other than setPixel(), but I don't know what.
I am using the Fast.Led library with Arduino Nano and WS2812B LEDs
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;
}


user11982: I can't tell exactly whats not working with your code,it would be really helpful if you elaborate more. 
But here is some code that I wrote and I think it will get the job done:
//declare our variables:
int myPins[] = {2, 4, 8, 3, 6}; //Enter the number of the pins being used
int RNum = 0;

void loop()
{
    DigitalWrite(myPins[RNum],LOW);
    RNum = Random(0,MAX) // MAX being the number of LEDs connected minus one 
    //the above generates a random number
    DigitalWrite(myPins[RNum],High);
}

This will turn on one LED at a time.

8162: <p>How can I make LEDs blink randomly?</p>

<p>I found a piece of code, but it is not working for me. I probably need something other than <code>setPixel()</code>, but I don't know what.</p>

<p>I am using the <a href="https://github.com/FastLED/FastLED" rel="nofollow">Fast.Led library</a> with Arduino Nano and WS2812B LEDs</p>

<pre class="lang-c prettyprint-override"><code>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 &lt; 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;
}
</code></pre>
 11982: <p>I can't tell exactly whats not working with your code,it would be really helpful if you elaborate more. 
But here is some code that I wrote and I think it will get the job done:</p>

<pre><code>//declare our variables:
int myPins[] = {2, 4, 8, 3, 6}; //Enter the number of the pins being used
int RNum = 0;

void loop()
{
    DigitalWrite(myPins[RNum],LOW);
    RNum = Random(0,MAX) // MAX being the number of LEDs connected minus one 
    //the above generates a random number
    DigitalWrite(myPins[RNum],High);
}
</code></pre>

<p>This will turn on one LED at a time.</p>
