# Addressing multiple LED strips simultaneously for a light show

**URL:** <https://forum.arduino.cc/t/addressing-multiple-led-strips-simultaneously-for-a-light-show/991257>\
**Category:** LEDs and Multiplexing\
**Created:** [May 12, 2022, 9:07pm UTC](https://forum.arduino.cc/t/addressing-multiple-led-strips-simultaneously-for-a-light-show/991257 "2022-05-12T21:07:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dagon6789](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@dagon6789](https://forum.arduino.cc/u/dagon6789)\
**Post date:** [May 12, 2022, 9:07pm UTC](https://forum.arduino.cc/t/addressing-multiple-led-strips-simultaneously-for-a-light-show/991257/1 "2022-05-12T21:07:35Z")

</div>

Hi folks,

I am trying to build a LED strip setup to create a light show for music. I have read some articles on the forum to get basic ideas to implement this project. Furthermore, I intend to manually program which LED (strip) show at which time.

My question is, how can I address each LED strip individually without making the other strips wait during the necessary delay?

The code below makes the first strip glow red for 1 s with increasing brightness. Then the second strip starts to glow for 1 s with increasing brightness. This code works on my hardware (Mega2560 and NeoPixels).

For example, how can I make the second strip start to glow after 0.5 s (during the first glow). In my opinion, I would have to somehow cut the first loops. Is there a better way to do this?

I hope I didn't miss a similar question in the forum!

Thanks in advance! 🙂

```cpp
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif
#define PIN6 6
#define PIN7 7
#define NUMPIXELS 5

Adafruit_NeoPixel strip1(NUMPIXELS, PIN6, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip2(NUMPIXELS, PIN7, NEO_GRB + NEO_KHZ800);

void setup() {
#if defined( __AVR_ATtiny85__ ) && (F_CPU == 16000000)
  clock_prescale_set(clock_div_1);
#endif

  strip1.begin();
  strip2.begin();
}

void loop() {
  
  strip1.clear();
  strip2.clear();

  for(int i=0; i<50; i++) {
    for(int j=0; j<NUMPIXELS; j++) {
      strip1.setPixelColor(j, strip1.Color(i, 0, 0));
    }
  strip1.show();
  delay(20);
  }

  delay(500);
  strip1.clear();
  strip1.show();
  delay(500);

  for(int i=0; i<50; i++) {
    for(int j=0; j<NUMPIXELS; j++) {
      strip2.setPixelColor(j, strip2.Color(i, 0, 0));
    }
  strip2.show();
  delay(20);
  }

  delay(500);
  strip2.clear();
  strip2.show();
  delay(500);
  
}

```

---

<div class="post-metadata">

**Author:** ![groundFungus](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@groundFungus](https://forum.arduino.cc/u/groundFungus)\
**Post date:** [May 12, 2022, 9:14pm UTC](https://forum.arduino.cc/t/addressing-multiple-led-strips-simultaneously-for-a-light-show/991257/2 "2022-05-12T21:14:54Z")

</div>

> [@dagon6789](#):
>
> how can I address each LED strip individually without making the other strips wait during the necessary delay?

Do not use delay(). Use millis() or micros() for timing as shown in these tutorials.  
[Blink without delay().](https://www.arduino.cc/en/tutorial/BlinkWithoutDelay)  
[Beginner's guide to millis().](https://forum.arduino.cc/index.php?topic=503368.0)  
[Several things at a time.](https://forum.arduino.cc/index.php?topic=223286.0)

> [@dagon6789](#):
>
> For example, how can I make the second strip start to glow after 0.5 s (during the first glow). In my opinion, I would have to somehow cut the first loops. Is there a better way to do this?

Don't use for loops (or while loops). They block execution. Do stuff a step at a time instead of all at once. The tutorials help to show how.

---

<div class="post-metadata">

**Author:** ![dagon6789](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@dagon6789](https://forum.arduino.cc/u/dagon6789)\
**Post date:** [May 12, 2022, 9:18pm UTC](https://forum.arduino.cc/t/addressing-multiple-led-strips-simultaneously-for-a-light-show/991257/3 "2022-05-12T21:18:43Z")

</div>

Thanks for pointing me there! 🙂  
I will mark this as the answer and read those tutorials.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [November 8, 2022, 9:18pm UTC](https://forum.arduino.cc/t/addressing-multiple-led-strips-simultaneously-for-a-light-show/991257/4 "2022-11-08T21:18:47Z")

</div>

Closed on November 8, 2022, 9:18pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
