How can I run multiple separate loops independently from one another in Arduino IDE?
18:11 25 Jan 2026

I'm trying to make 3 LEDs (a red, a green, and a blue) flash simultaneously. The blue one should flash slowly, the green one should go quicker, and the red should be fastest. I tried putting multiple void loop() s but I got an error that it was redefined, so I made it look like this:

int bluLED=13;
int grnLED=12;
int redLED=11;

void setup() {
  
  pinMode(bluLED, OUTPUT);
  pinMode(grnLED, OUTPUT);
  pinMode(redLED, OUTPUT);
}


void loop() {
  blueLoop();
  greenLoop();
  redLoop();
}
void blueLoop() {
  digitalWrite(bluLED, HIGH);
  delay(1000);
  digitalWrite(bluLED, LOW);
  delay(100);
}

void greenLoop() {
  digitalWrite(grnLED, HIGH);
  delay(500);
  digitalWrite(grnLED, LOW);
  delay(500);

}

void redLoop() {
  digitalWrite(redLED, HIGH);
  delay(100);
  digitalWrite(redLED, LOW);
  delay(100);

}

and that's the closest I've gotten. It runs the blue loop, then the green loop, then the red, but that's not my main objective. I'm using the Arduino Uno R3 board, and I've already verified my wiring to the breadboard is alright. From what I've seen, I think Arduino also might just not support having multiple loops, and I'd need to just rewrite my code using something other than delay() .

  • How can I make it run multiple loops independently?

  • Is it just that Arduino doesn't do that?

  • If so, how can I make it "appear" independent?

loops arduino arduino-uno