Thanks for your help! I finally managed to get to a setup I like ![]()
I now have:
2 leds which blink at a different pace
1 led which blinks randomly
1 led which flashes 3 times and waits for a bit and flashes 3 times again
/* Multiple independent delay - 3 different blinking patterns
 Written by several forum members. In public domain. Oct 2011.
Â
*/
// Which pins are connected to which LED
const byte led12 = 13;
const byte led11 = 12 ;
const int led3 = 4 ;
const byte led9 = 10 ;
// Time periods of blinks in milliseconds (1000 milliseconds to a second).
// Time variable and constants are always unsigned long
const unsigned long led12interval = 300UL ;
const unsigned long led11interval = 350UL ;
unsigned long previousMillis;
unsigned long previousMillisrandom;
unsigned long intervalblinkrandom = 200UL;Â // not a constant, it will be changed
unsigned long currentMillis = millis();
unsigned long currentMillisblinkrandom = millis();
unsigned long currentMillisblink = millis();
// Variable holding the timer value so far. One for each "Timer"
unsigned long led12timer = 0 ;
unsigned long led11timer = 0 ;
unsigned long led3timer = 0 ;
unsigned long led9timer = 0 ;
unsigned long waitUntil = 0;
// Variable to know what the current LED state is
int led12State = LOW ;
int led11State = LOW ;
int led3State = LOW ;
int led9State = LOW ;
const unsigned long intervalblink = 50;
int counter = 0;
void setup() {
 pinMode (led12, OUTPUT) ;
 pinMode (led11, OUTPUT) ;
 pinMode (led3, OUTPUT) ;
 pinMode (led9, OUTPUT) ;
 led12timer = millis () ;
 led11timer = millis () ;
 led3timer = millis () ;
 waitUntil += intervalblinkrandom;
}
void loop()
{
 // Handling the blink of one LED.
 // First, check if it is time to change state
 if ( (millis () - led12timer) >= led12interval ) {
  // It is time to change state. Calculate next state.
  if (led12State == LOW)
   led12State = HIGH ;
  else
   led12State = LOW ;
  // Write new state
  digitalWrite (led12, led12State ) ;
  // Reset timer
  led12timer = millis () ;
 }
 // The other LED is controlled the same way. Repeat for more LEDs
 if ( (millis () - led11timer) >= led11interval ) {
  if (led11State == LOW)
   led11State = HIGH ;
  else
   led11State = LOW ;
  digitalWrite (led11, led11State ) ;
  led11timer = millis () ;
 }
 unsigned long currentMillisrandom = millis();
 if ( currentMillisrandom - previousMillisrandom >= intervalblinkrandom)
 {
  previousMillisrandom = currentMillisrandom;
  intervalblinkrandom = random( 25, 300); // set the new interval
  // toggle
  digitalWrite( led9, digitalRead( led9) == HIGH ? LOW : HIGH);
 }
 unsigned long currentMillisblink = millis();
 if ( currentMillisblink - previousMillis >= intervalblink)
 {
  previousMillis = currentMillisblink;
  // Select what to do with certain values of counter.
  switch ( counter)
  {
   case 0:
   case 2:
   case 4:
    digitalWrite( led3, HIGH);
    break;
   case 1:
   case 3:
   case 5:
    digitalWrite( led3, LOW);
    break;
  }
  counter++;
  if ( counter >= 25)
  {
   counter = 0;
  }
 }
}
Thanks for your quick help!