Saltwater reef tank LED light with lightning storm.

After rewriting this thing like 4 times with the help of countless forum members (thanks to all) it’s done. If you google around for reef lighting that has a thunderstorm or lightning storm mode you will see that almost 99% of them use blink. Which is ok I guess but it looks cheesy to me. I found one guy who had a dim in and dim out that looked almost worse. Even the LED lights that reef product companies make only have the blink effect and you can pay up to $1000.00 for them.

So I got a 20W LED that has 6 Royal blue and 3 pure white in the chip. Works amazing and looks really good over coral.
You can see the sketch running here for just the lightning

But the full script below handles my full allday function. Sunrise and sunset.

int ledPin11 = 11;
int burst; //short burst of light
int big;
int srumble;
int brumble;
int mixer;
int diming;
int delaymix;
int dark;
int lightningtimer;
int lightningtime;

void setup (){}
void loop (){
  //30 Min sunrise
  for(int fadeValue = 0; fadeValue < 191; fadeValue +=1)
  {
  analogWrite(ledPin11, fadeValue);
  delay(9411);
  }
  
  //8 hours of solid day light
  analogWrite(ledPin11, 191);
  delay(28800000);
  
  //2 Min cloud cover (Dark)
  for(int fadeValue = 191; fadeValue > 0; fadeValue -=1)
  {
  analogWrite(ledPin11, fadeValue);
  delay(628);
  }

//Random lighting storm of bursts and flickers
unsigned long now = millis();
  lightningtime = 120000;
  lightningtimer = now;

if (now - lightningtimer < lightningtime)
 {
  burst = random(10,500); //Short burst of lightning value
  big = random(1000,4000);//long burst of lightning value
  srumble = random(10,40);//lower light lighting value
  brumble = random(10,150);//higher light lightning value
  mixer = random(burst,big);//random pick of short or long bursts of lightning
  dark = random(1000,12000);//random pick of time gap for lightning
  for(int i = 0; i < mixer; i += diming++)
  {
  diming = random(1,150);
  analogWrite(ledPin11, random(srumble,brumble));//Turn on LED for short or long burst
  delay(diming);//random number delay to remain at set brightness value
}
  digitalWrite(ledPin11, LOW);    // turn the LED off
delay(dark);
  }
  //2 min cloud clearing (light)
  for(int fadeValue = 0; fadeValue < 191; fadeValue +=1)
  {
  analogWrite(ledPin11, fadeValue);
  delay(628);
}
  
  //30 min sunset//
  for(int fadeValue = 191; fadeValue > 0; fadeValue -=1)
  {
  analogWrite(ledPin11, fadeValue);
  delay(9411);
}
  
  //Delay to reach the end of psu timer.
  delay(500000);

}

How would this work in a controller setup? wouldn’t the delay stop all other processing ?

Yes, the Delay in the code would stop everything. That is easy enough to fix though ;-)