Random Strobe Code help

Hello,

I recently realized an attiny13a was driving a flashlight driver board of mine. This has inspired me to code a custom driver program. So far I hope I'm on the right track with my program, but I need help with one feature:

at the 30s mark he engages random strobe. Isn't it brutal? How do I code this madness? If someone could generalize it for me that'd be awesome.

Thanks for your time,
kl3vr

It's just like the Blink or Blink Without Delay examples but using the function random() to pick on and off times.

just add the following line at a strategic place:

interval = random(min, max); // fill in appropiate values for min and max Note they are milliseconds.

In an elaborated version you could use different timing or fixed for the OFF and for the ON phase of the LEDs or take care that ON + OFF is a fixed time
(fixed frequency, random duty cycle)

ok i'm am only a beginner but try this
it should set how long the light will be on and off

void loop() {
  ontime = random(20, 50);
  offtime = random(20, 50);
  digitalWrite(13, HIGH);
  delay(ontime);
  digitalWrite(13, LOW);
  delay(offtime);
}

Thanks for the responses. I had tried a delay(random(min,max)) before but didn't like the effect, probably the 5mm led was too weak to imitate a flashlight's strobe. Anyways thanks again!