WS2811 led random effect

Hey guys

I want to have a strip of WS2811 LEDs to randomly flicker/strobe white (on and off not 0--> 100%). Would anyone already have some code to do this. I'm using a Arduino UNO by the way

Thanks
Ian

Try this for a start :slight_smile:

// Assuming your output pin is 5


const byte ledPin = 5;
const byte dur = 30; // duration of blink
const int mn = 50, mx = 1000; // interval between blinks
unsigned long strt;
unsigned long ival; // interval between blinks
byte cnt;



void setup() {
pinMode(ledPin,OUTPUT);
strt = millis();
}

void loop() {
  if(cnt > 25){
    randomSeed(analogRead(5)); // new seed after 25 blinks
    cnt = 0;
  }  
  if(millis() - strt > ival) digitalWrite(ledPin,HIGH);
  if(millis() - strt > ival + dur){
    digitalWrite(ledPin,LOW);
    ival = random(mn,mx);
    strt = millis(); cnt++;
  }
}

Have a look at the FastLED Animation Library.