# Codierung von 10 Neopixel / WS2818 Stripes ( 900 LEDs)

**URL:** <https://forum.arduino.cc/t/codierung-von-10-neopixel-ws2818-stripes-900-leds/985323>\
**Category:** Deutsch\
**Created:** [April 26, 2022, 3:40pm UTC](https://forum.arduino.cc/t/codierung-von-10-neopixel-ws2818-stripes-900-leds/985323 "2022-04-26T15:40:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonym-user-015](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@anonym-user-015](https://forum.arduino.cc/u/anonym-user-015)\
**Post date:** [April 26, 2022, 3:40pm UTC](https://forum.arduino.cc/t/codierung-von-10-neopixel-ws2818-stripes-900-leds/985323/1 "2022-04-26T15:40:12Z")

</div>

Moin,

ich will in meinem Gaming Zimmer die Ultimative RGB Beleuchtung haben, deshalb habe ich mir 15 Meter WS2818 also Neopixels bestellt und verlegt (Unter Tischen, in Schränken, an Monitoren usw.)

Ziel dieses Projektes ist jeden einzelnen Strip in eigenem RGB-Verlauf-Rhythmus durchlaufen zu lassen.

Ein Netzteil mit 5V 60A also 300W wird die LEDs versorgen (Müsste nach meinen Berechnungen ausreichen)

Ich habe 15 Stripes Insgesamt verlegt, welche jedoch logisch zusammengefasst (Weil manche zb Übereinander sind und dieselben Animationen brauchen) 10 Stripes sind.  
Hier die Anzahl von LEDs der verschiedenen Stripes:

Stripe 1: 65 LEDs  
Stripe 2: 44 LEDs  
Stripe 3: 75 LEDs  
Stripe 4: 28 LEDs  
Stripe 5: 52 LEDs  
Stripe 6: 22 LEDs  
Stripe 7: 102 LEDs  
Stripe 8: 92 LEDs  
Stripe 9: 124 LEDs  
Stripe 10: 121 LEDs

Da ich nicht sehr gut im Coden bin habe ich mir diesen Code auf einer Website erstellt. Jedoch weis ich nicht ob dieser funktionieren würde, vielleicht könnt ihr mir da weiterhelfen.

```cpp
#include <Adafruit_NeoPixel.h>

class Strip
{
public:
  uint8_t effect;
  uint8_t effects;
  uint16_t effStep;
  unsigned long effStart;
  Adafruit_NeoPixel strip;
  Strip(uint16_t leds, uint8_t pin, uint8_t toteffects, uint16_t striptype) : strip(leds, pin, striptype) {
    effect = -1;
    effects = toteffects;
    Reset();
  }
  void Reset(){
    effStep = 0;
    effect = (effect + 1) % effects;
    effStart = millis();
  }
};

struct Loop
{
  uint8_t currentChild;
  uint8_t childs;
  bool timeBased;
  uint16_t cycles;
  uint16_t currentTime;
  Loop(uint8_t totchilds, bool timebased, uint16_t tottime) {currentTime=0;currentChild=0;childs=totchilds;timeBased=timebased;cycles=tottime;}
};

Strip strip_0(65, 2, 65, NEO_GRB + NEO_KHZ800);
Strip strip_1(44, 3, 44, NEO_GRB + NEO_KHZ800);
Strip strip_2(75, 4, 75, NEO_GRB + NEO_KHZ800);
Strip strip_3(28, 5, 28, NEO_GRB + NEO_KHZ800);
Strip strip_4(52, 6, 52, NEO_GRB + NEO_KHZ800);
Strip strip_5(22, 7, 22, NEO_GRB + NEO_KHZ800);
Strip strip_6(102, 8, 102, NEO_GRB + NEO_KHZ800);
Strip strip_7(92, 9, 92, NEO_GRB + NEO_KHZ800);
Strip strip_8(124, 10, 124, NEO_GRB + NEO_KHZ800);
Strip strip_9(121, 11, 121, NEO_GRB + NEO_KHZ800);
struct Loop strip0loop0(1, false, 1);
struct Loop strip1loop0(1, false, 1);
struct Loop strip2loop0(1, false, 1);
struct Loop strip3loop0(1, false, 1);
struct Loop strip4loop0(1, false, 1);
struct Loop strip5loop0(1, false, 1);
struct Loop strip6loop0(1, false, 1);
struct Loop strip7loop0(1, false, 1);
struct Loop strip8loop0(1, false, 1);
struct Loop strip9loop0(1, false, 1);

//[GLOBAL_VARIABLES]

void setup() {

  //Your setup here:

  strip_0.strip.begin();
  strip_1.strip.begin();
  strip_2.strip.begin();
  strip_3.strip.begin();
  strip_4.strip.begin();
  strip_5.strip.begin();
  strip_6.strip.begin();
  strip_7.strip.begin();
  strip_8.strip.begin();
  strip_9.strip.begin();
}

void loop() {

  //Your code here:

  strips_loop();
}

void strips_loop() {
  if(strip0_loop0() & 0x01)
    strip_0.strip.show();
  if(strip1_loop0() & 0x01)
    strip_1.strip.show();
  if(strip2_loop0() & 0x01)
    strip_2.strip.show();
  if(strip3_loop0() & 0x01)
    strip_3.strip.show();
  if(strip4_loop0() & 0x01)
    strip_4.strip.show();
  if(strip5_loop0() & 0x01)
    strip_5.strip.show();
  if(strip6_loop0() & 0x01)
    strip_6.strip.show();
  if(strip7_loop0() & 0x01)
    strip_7.strip.show();
  if(strip8_loop0() & 0x01)
    strip_8.strip.show();
  if(strip9_loop0() & 0x01)
    strip_9.strip.show();
}

uint8_t strip0_loop0() {
  uint8_t ret = 0x00;
  switch(strip0loop0.currentChild) {
    case 0: 
           ret = strip0_loop0_eff0();break;
  }
  if(ret & 0x02) {
    ret &= 0xfd;
    if(strip0loop0.currentChild + 1 >= strip0loop0.childs) {
      strip0loop0.currentChild = 0;
      if(++strip0loop0.currentTime >= strip0loop0.cycles) {strip0loop0.currentTime = 0; ret |= 0x02;}
    }
    else {
      strip0loop0.currentChild++;
    }
  };
  return ret;
}

uint8_t strip0_loop0_eff0() {
    // Strip ID: 0 - Effect: Rainbow - LEDS: 65
    // Steps: 60 - Delay: 20
    // Colors: 3 (255.0.0, 0.255.0, 0.0.255)
    // Options: rainbowlen=60, toLeft=true, 
  if(millis() - strip_0.effStart < 20 * (strip_0.effStep)) return 0x00;
  float factor1, factor2;
  uint16_t ind;
  for(uint16_t j=0;j<65;j++) {
    ind = strip_0.effStep + j * 1;
    switch((int)((ind % 60) / 20)) {
      case 0: factor1 = 1.0 - ((float)(ind % 60 - 0 * 20) / 20);
              factor2 = (float)((int)(ind - 0) % 60) / 20;
              strip_0.strip.setPixelColor(j, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2);
              break;
      case 1: factor1 = 1.0 - ((float)(ind % 60 - 1 * 20) / 20);
              factor2 = (float)((int)(ind - 20) % 60) / 20;
              strip_0.strip.setPixelColor(j, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2);
              break;
      case 2: factor1 = 1.0 - ((float)(ind % 60 - 2 * 20) / 20);
              factor2 = (float)((int)(ind - 40) % 60) / 20;
              strip_0.strip.setPixelColor(j, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2);
              break;
    }
  }
  if(strip_0.effStep >= 60) {strip_0.Reset(); return 0x03; }
  else strip_0.effStep++;
  return 0x01;
}

uint8_t strip1_loop0() {
  uint8_t ret = 0x00;
  switch(strip1loop0.currentChild) {
    case 0: 
           ret = strip1_loop0_eff0();break;
  }
  if(ret & 0x02) {
    ret &= 0xfd;
    if(strip1loop0.currentChild + 1 >= strip1loop0.childs) {
      strip1loop0.currentChild = 0;
      if(++strip1loop0.currentTime >= strip1loop0.cycles) {strip1loop0.currentTime = 0; ret |= 0x02;}
    }
    else {
      strip1loop0.currentChild++;
    }
  };
  return ret;
}

uint8_t strip1_loop0_eff0() {
    // Strip ID: 1 - Effect: Rainbow - LEDS: 44
    // Steps: 44 - Delay: 20
    // Colors: 3 (255.0.0, 0.255.0, 0.0.255)
    // Options: rainbowlen=44, toLeft=true, 
  if(millis() - strip_1.effStart < 20 * (strip_1.effStep)) return 0x00;
  float factor1, factor2;
  uint16_t ind;
  for(uint16_t j=0;j<44;j++) {
    ind = strip_1.effStep + j * 1;
    switch((int)((ind % 44) / 14.666666666666666)) {
      case 0: factor1 = 1.0 - ((float)(ind % 44 - 0 * 14.666666666666666) / 14.666666666666666);
              factor2 = (float)((int)(ind - 0) % 44) / 14.666666666666666;
              strip_1.strip.setPixelColor(j, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2);
              break;
      case 1: factor1 = 1.0 - ((float)(ind % 44 - 1 * 14.666666666666666) / 14.666666666666666);
              factor2 = (float)((int)(ind - 14.666666666666666) % 44) / 14.666666666666666;
              strip_1.strip.setPixelColor(j, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2);
              break;
      case 2: factor1 = 1.0 - ((float)(ind % 44 - 2 * 14.666666666666666) / 14.666666666666666);
              factor2 = (float)((int)(ind - 29.333333333333332) % 44) / 14.666666666666666;
              strip_1.strip.setPixelColor(j, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2);
              break;
    }
  }
  if(strip_1.effStep >= 44) {strip_1.Reset(); return 0x03; }
  else strip_1.effStep++;
  return 0x01;
}

uint8_t strip2_loop0() {
  uint8_t ret = 0x00;
  switch(strip2loop0.currentChild) {
    case 0: 
           ret = strip2_loop0_eff0();break;
  }
  if(ret & 0x02) {
    ret &= 0xfd;
    if(strip2loop0.currentChild + 1 >= strip2loop0.childs) {
      strip2loop0.currentChild = 0;
      if(++strip2loop0.currentTime >= strip2loop0.cycles) {strip2loop0.currentTime = 0; ret |= 0x02;}
    }
    else {
      strip2loop0.currentChild++;
    }
  };
  return ret;
}

uint8_t strip2_loop0_eff0() {
    // Strip ID: 2 - Effect: Rainbow - LEDS: 75
    // Steps: 60 - Delay: 20
    // Colors: 3 (255.0.0, 0.255.0, 0.0.255)
    // Options: rainbowlen=60, toLeft=true, 
  if(millis() - strip_2.effStart < 20 * (strip_2.effStep)) return 0x00;
  float factor1, factor2;
  uint16_t ind;
  for(uint16_t j=0;j<75;j++) {
    ind = strip_2.effStep + j * 1;
    switch((int)((ind % 60) / 20)) {
      case 0: factor1 = 1.0 - ((float)(ind % 60 - 0 * 20) / 20);
              factor2 = (float)((int)(ind - 0) % 60) / 20;
              strip_2.strip.setPixelColor(j, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2);
              break;
      case 1: factor1 = 1.0 - ((float)(ind % 60 - 1 * 20) / 20);
              factor2 = (float)((int)(ind - 20) % 60) / 20;
              strip_2.strip.setPixelColor(j, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2);
              break;
      case 2: factor1 = 1.0 - ((float)(ind % 60 - 2 * 20) / 20);
              factor2 = (float)((int)(ind - 40) % 60) / 20;
              strip_2.strip.setPixelColor(j, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2);
              break;
    }
  }
  if(strip_2.effStep >= 60) {strip_2.Reset(); return 0x03; }
  else strip_2.effStep++;
  return 0x01;
}

uint8_t strip3_loop0() {
  uint8_t ret = 0x00;
  switch(strip3loop0.currentChild) {
    case 0: 
           ret = strip3_loop0_eff0();break;
  }
  if(ret & 0x02) {
    ret &= 0xfd;
    if(strip3loop0.currentChild + 1 >= strip3loop0.childs) {
      strip3loop0.currentChild = 0;
      if(++strip3loop0.currentTime >= strip3loop0.cycles) {strip3loop0.currentTime = 0; ret |= 0x02;}
    }
    else {
      strip3loop0.currentChild++;
    }
  };
  return ret;
}

uint8_t strip3_loop0_eff0() {
    // Strip ID: 3 - Effect: Rainbow - LEDS: 28
    // Steps: 60 - Delay: 20
    // Colors: 3 (255.0.0, 0.255.0, 0.0.255)
    // Options: rainbowlen=60, toLeft=true, 
  if(millis() - strip_3.effStart < 20 * (strip_3.effStep)) return 0x00;
  float factor1, factor2;
  uint16_t ind;
  for(uint16_t j=0;j<28;j++) {
    ind = strip_3.effStep + j * 1;
    switch((int)((ind % 60) / 20)) {
      case 0: factor1 = 1.0 - ((float)(ind % 60 - 0 * 20) / 20);
              factor2 = (float)((int)(ind - 0) % 60) / 20;
              strip_3.strip.setPixelColor(j, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2);
              break;
      case 1: factor1 = 1.0 - ((float)(ind % 60 - 1 * 20) / 20);
              factor2 = (float)((int)(ind - 20) % 60) / 20;
              strip_3.strip.setPixelColor(j, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2);
              break;
      case 2: factor1 = 1.0 - ((float)(ind % 60 - 2 * 20) / 20);
              factor2 = (float)((int)(ind - 40) % 60) / 20;
              strip_3.strip.setPixelColor(j, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2);
              break;
    }
  }
  if(strip_3.effStep >= 60) {strip_3.Reset(); return 0x03; }
  else strip_3.effStep++;
  return 0x01;
}

uint8_t strip4_loop0() {
  uint8_t ret = 0x00;
  switch(strip4loop0.currentChild) {
    case 0: 
           ret = strip4_loop0_eff0();break;
  }
  if(ret & 0x02) {
    ret &= 0xfd;
    if(strip4loop0.currentChild + 1 >= strip4loop0.childs) {
      strip4loop0.currentChild = 0;
      if(++strip4loop0.currentTime >= strip4loop0.cycles) {strip4loop0.currentTime = 0; ret |= 0x02;}
    }
    else {
      strip4loop0.currentChild++;
    }
  };
  return ret;
}

uint8_t strip4_loop0_eff0() {
    // Strip ID: 4 - Effect: Rainbow - LEDS: 52
    // Steps: 60 - Delay: 20
    // Colors: 3 (255.0.0, 0.255.0, 0.0.255)
    // Options: rainbowlen=60, toLeft=true, 
  if(millis() - strip_4.effStart < 20 * (strip_4.effStep)) return 0x00;
  float factor1, factor2;
  uint16_t ind;
  for(uint16_t j=0;j<52;j++) {
    ind = strip_4.effStep + j * 1;
    switch((int)((ind % 60) / 20)) {
      case 0: factor1 = 1.0 - ((float)(ind % 60 - 0 * 20) / 20);
              factor2 = (float)((int)(ind - 0) % 60) / 20;
              strip_4.strip.setPixelColor(j, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2);
              break;
      case 1: factor1 = 1.0 - ((float)(ind % 60 - 1 * 20) / 20);
              factor2 = (float)((int)(ind - 20) % 60) / 20;
              strip_4.strip.setPixelColor(j, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2);
              break;
      case 2: factor1 = 1.0 - ((float)(ind % 60 - 2 * 20) / 20);
              factor2 = (float)((int)(ind - 40) % 60) / 20;
              strip_4.strip.setPixelColor(j, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2);
              break;
    }
  }
  if(strip_4.effStep >= 60) {strip_4.Reset(); return 0x03; }
  else strip_4.effStep++;
  return 0x01;
}

uint8_t strip5_loop0() {
  uint8_t ret = 0x00;
  switch(strip5loop0.currentChild) {
    case 0: 
           ret = strip5_loop0_eff0();break;
  }
  if(ret & 0x02) {
    ret &= 0xfd;
    if(strip5loop0.currentChild + 1 >= strip5loop0.childs) {
      strip5loop0.currentChild = 0;
      if(++strip5loop0.currentTime >= strip5loop0.cycles) {strip5loop0.currentTime = 0; ret |= 0x02;}
    }
    else {
      strip5loop0.currentChild++;
    }
  };
  return ret;
}

uint8_t strip5_loop0_eff0() {
    // Strip ID: 5 - Effect: Rainbow - LEDS: 22
    // Steps: 60 - Delay: 20
    // Colors: 3 (255.0.0, 0.255.0, 0.0.255)
    // Options: rainbowlen=60, toLeft=true, 
  if(millis() - strip_5.effStart < 20 * (strip_5.effStep)) return 0x00;
  float factor1, factor2;
  uint16_t ind;
  for(uint16_t j=0;j<22;j++) {
    ind = strip_5.effStep + j * 1;
    switch((int)((ind % 60) / 20)) {
      case 0: factor1 = 1.0 - ((float)(ind % 60 - 0 * 20) / 20);
              factor2 = (float)((int)(ind - 0) % 60) / 20;
              strip_5.strip.setPixelColor(j, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2);
              break;
      case 1: factor1 = 1.0 - ((float)(ind % 60 - 1 * 20) / 20);
              factor2 = (float)((int)(ind - 20) % 60) / 20;
              strip_5.strip.setPixelColor(j, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2);
              break;
      case 2: factor1 = 1.0 - ((float)(ind % 60 - 2 * 20) / 20);
              factor2 = (float)((int)(ind - 40) % 60) / 20;
              strip_5.strip.setPixelColor(j, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2);
              break;
    }
  }
  if(strip_5.effStep >= 60) {strip_5.Reset(); return 0x03; }
  else strip_5.effStep++;
  return 0x01;
}

uint8_t strip6_loop0() {
  uint8_t ret = 0x00;
  switch(strip6loop0.currentChild) {
    case 0: 
           ret = strip6_loop0_eff0();break;
  }
  if(ret & 0x02) {
    ret &= 0xfd;
    if(strip6loop0.currentChild + 1 >= strip6loop0.childs) {
      strip6loop0.currentChild = 0;
      if(++strip6loop0.currentTime >= strip6loop0.cycles) {strip6loop0.currentTime = 0; ret |= 0x02;}
    }
    else {
      strip6loop0.currentChild++;
    }
  };
  return ret;
}

uint8_t strip6_loop0_eff0() {
    // Strip ID: 6 - Effect: Rainbow - LEDS: 102
    // Steps: 60 - Delay: 20
    // Colors: 3 (255.0.0, 0.255.0, 0.0.255)
    // Options: rainbowlen=60, toLeft=true, 
  if(millis() - strip_6.effStart < 20 * (strip_6.effStep)) return 0x00;
  float factor1, factor2;
  uint16_t ind;
  for(uint16_t j=0;j<102;j++) {
    ind = strip_6.effStep + j * 1;
    switch((int)((ind % 60) / 20)) {
      case 0: factor1 = 1.0 - ((float)(ind % 60 - 0 * 20) / 20);
              factor2 = (float)((int)(ind - 0) % 60) / 20;
              strip_6.strip.setPixelColor(j, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2);
              break;
      case 1: factor1 = 1.0 - ((float)(ind % 60 - 1 * 20) / 20);
              factor2 = (float)((int)(ind - 20) % 60) / 20;
              strip_6.strip.setPixelColor(j, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2);
              break;
      case 2: factor1 = 1.0 - ((float)(ind % 60 - 2 * 20) / 20);
              factor2 = (float)((int)(ind - 40) % 60) / 20;
              strip_6.strip.setPixelColor(j, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2);
              break;
    }
  }
  if(strip_6.effStep >= 60) {strip_6.Reset(); return 0x03; }
  else strip_6.effStep++;
  return 0x01;
}

uint8_t strip7_loop0() {
  uint8_t ret = 0x00;
  switch(strip7loop0.currentChild) {
    case 0: 
           ret = strip7_loop0_eff0();break;
  }
  if(ret & 0x02) {
    ret &= 0xfd;
    if(strip7loop0.currentChild + 1 >= strip7loop0.childs) {
      strip7loop0.currentChild = 0;
      if(++strip7loop0.currentTime >= strip7loop0.cycles) {strip7loop0.currentTime = 0; ret |= 0x02;}
    }
    else {
      strip7loop0.currentChild++;
    }
  };
  return ret;
}

uint8_t strip7_loop0_eff0() {
    // Strip ID: 7 - Effect: Rainbow - LEDS: 92
    // Steps: 60 - Delay: 20
    // Colors: 3 (255.0.0, 0.255.0, 0.0.255)
    // Options: rainbowlen=60, toLeft=true, 
  if(millis() - strip_7.effStart < 20 * (strip_7.effStep)) return 0x00;
  float factor1, factor2;
  uint16_t ind;
  for(uint16_t j=0;j<92;j++) {
    ind = strip_7.effStep + j * 1;
    switch((int)((ind % 60) / 20)) {
      case 0: factor1 = 1.0 - ((float)(ind % 60 - 0 * 20) / 20);
              factor2 = (float)((int)(ind - 0) % 60) / 20;
              strip_7.strip.setPixelColor(j, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2);
              break;
      case 1: factor1 = 1.0 - ((float)(ind % 60 - 1 * 20) / 20);
              factor2 = (float)((int)(ind - 20) % 60) / 20;
              strip_7.strip.setPixelColor(j, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2);
              break;
      case 2: factor1 = 1.0 - ((float)(ind % 60 - 2 * 20) / 20);
              factor2 = (float)((int)(ind - 40) % 60) / 20;
              strip_7.strip.setPixelColor(j, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2);
              break;
    }
  }
  if(strip_7.effStep >= 60) {strip_7.Reset(); return 0x03; }
  else strip_7.effStep++;
  return 0x01;
}

uint8_t strip8_loop0() {
  uint8_t ret = 0x00;
  switch(strip8loop0.currentChild) {
    case 0: 
           ret = strip8_loop0_eff0();break;
  }
  if(ret & 0x02) {
    ret &= 0xfd;
    if(strip8loop0.currentChild + 1 >= strip8loop0.childs) {
      strip8loop0.currentChild = 0;
      if(++strip8loop0.currentTime >= strip8loop0.cycles) {strip8loop0.currentTime = 0; ret |= 0x02;}
    }
    else {
      strip8loop0.currentChild++;
    }
  };
  return ret;
}

uint8_t strip8_loop0_eff0() {
    // Strip ID: 8 - Effect: Rainbow - LEDS: 124
    // Steps: 60 - Delay: 20
    // Colors: 3 (255.0.0, 0.255.0, 0.0.255)
    // Options: rainbowlen=60, toLeft=true, 
  if(millis() - strip_8.effStart < 20 * (strip_8.effStep)) return 0x00;
  float factor1, factor2;
  uint16_t ind;
  for(uint16_t j=0;j<124;j++) {
    ind = strip_8.effStep + j * 1;
    switch((int)((ind % 60) / 20)) {
      case 0: factor1 = 1.0 - ((float)(ind % 60 - 0 * 20) / 20);
              factor2 = (float)((int)(ind - 0) % 60) / 20;
              strip_8.strip.setPixelColor(j, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2);
              break;
      case 1: factor1 = 1.0 - ((float)(ind % 60 - 1 * 20) / 20);
              factor2 = (float)((int)(ind - 20) % 60) / 20;
              strip_8.strip.setPixelColor(j, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2);
              break;
      case 2: factor1 = 1.0 - ((float)(ind % 60 - 2 * 20) / 20);
              factor2 = (float)((int)(ind - 40) % 60) / 20;
              strip_8.strip.setPixelColor(j, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2);
              break;
    }
  }
  if(strip_8.effStep >= 60) {strip_8.Reset(); return 0x03; }
  else strip_8.effStep++;
  return 0x01;
}

uint8_t strip9_loop0() {
  uint8_t ret = 0x00;
  switch(strip9loop0.currentChild) {
    case 0: 
           ret = strip9_loop0_eff0();break;
  }
  if(ret & 0x02) {
    ret &= 0xfd;
    if(strip9loop0.currentChild + 1 >= strip9loop0.childs) {
      strip9loop0.currentChild = 0;
      if(++strip9loop0.currentTime >= strip9loop0.cycles) {strip9loop0.currentTime = 0; ret |= 0x02;}
    }
    else {
      strip9loop0.currentChild++;
    }
  };
  return ret;
}

uint8_t strip9_loop0_eff0() {
    // Strip ID: 9 - Effect: Rainbow - LEDS: 121
    // Steps: 60 - Delay: 20
    // Colors: 3 (255.0.0, 0.255.0, 0.0.255)
    // Options: rainbowlen=60, toLeft=true, 
  if(millis() - strip_9.effStart < 20 * (strip_9.effStep)) return 0x00;
  float factor1, factor2;
  uint16_t ind;
  for(uint16_t j=0;j<121;j++) {
    ind = strip_9.effStep + j * 1;
    switch((int)((ind % 60) / 20)) {
      case 0: factor1 = 1.0 - ((float)(ind % 60 - 0 * 20) / 20);
              factor2 = (float)((int)(ind - 0) % 60) / 20;
              strip_9.strip.setPixelColor(j, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2);
              break;
      case 1: factor1 = 1.0 - ((float)(ind % 60 - 1 * 20) / 20);
              factor2 = (float)((int)(ind - 20) % 60) / 20;
              strip_9.strip.setPixelColor(j, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2, 0 * factor1 + 255 * factor2);
              break;
      case 2: factor1 = 1.0 - ((float)(ind % 60 - 2 * 20) / 20);
              factor2 = (float)((int)(ind - 40) % 60) / 20;
              strip_9.strip.setPixelColor(j, 0 * factor1 + 255 * factor2, 0 * factor1 + 0 * factor2, 255 * factor1 + 0 * factor2);
              break;
    }
  }
  if(strip_9.effStep >= 60) {strip_9.Reset(); return 0x03; }
  else strip_9.effStep++;
  return 0x01;
}

```

Ich habe mir auch noch keinen Arduino gekauft und bin mir unsicher welchen ich nehmen soll.

Bei manchen Beiträgen steht das die Arduinos nicht unbedingt einen PWM Pin verwenden muss, da dies die eingebauten ICs der Neopixel übernehmen.

In diesem Fall würde ich mir einen Arduino Nano oder Arduino Uno kaufen.

Sollte das aber nicht stimmen würde ich mir den ATMega 2560kaufen welcher genügen PWM Pins hat.

Ich danke im Voraus für eure Hilfe,

LG  
~M

---

<div class="post-metadata">

**Author:** ![agmue](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/agmue/32/750067_2.png) [@agmue](https://forum.arduino.cc/u/agmue)\
**Post date:** [April 26, 2022, 4:41pm UTC](https://forum.arduino.cc/t/codierung-von-10-neopixel-ws2818-stripes-900-leds/985323/2 "2022-04-26T16:41:05Z")

</div>

> [@anonym-user-015](#):
>
> 15 Meter WS2818 also Neopixels

900 Pixel \* 60 mA/Pixel = 54 A entspricht 270 W Netzteil

Du benötigst richtig dicke Kabel, sonst brennt die Bude! Mit Flammen, Qualm und Feuerwehr, das willst Du nicht!

Wenn Du die Bestellung noch ändern kannst, rate ich Dir zu WS2815, die werden mit 12 V betrieben und benötigen daher kleinere Ströme, also dünnere Kabel.

> [@anonym-user-015](#):
>
> Bei manchen Beiträgen steht das die Arduinos nicht unbedingt einen PWM Pin verwenden muss, da dies die eingebauten ICs der Neopixel übernehmen.

Ja, stimmt.

> [@anonym-user-015](#):
>
> In diesem Fall würde ich mir einen Arduino Nano oder Arduino Uno kaufen.

Da dürfte Dir schnell der Speicher ausgehen, Du brauchst was mit mehr Wumms.

Vom Preis-Leistungsverhältnis würde ich momentan einen [ESP32](https://www.pollin.de/p/joy-it-esp32-node-mcu-modul-810873) nehmen, schneller mit mehr Speicher. Derzeit teuer oder nicht zu bekommen sind Mega2560 und [Teensy](https://www.pollin.de/p/pjrc-teensy-4-1-development-board-811183).

Schaue sie Dir mal an, bei Fragen bitte fragen.

Ob Adafruit\_NeoPixel zehn Objekte verarbeiten kann, habe ich noch nicht probiert.

---

<div class="post-metadata">

**Author:** ![anonym-user-015](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@anonym-user-015](https://forum.arduino.cc/u/anonym-user-015)\
**Post date:** [April 26, 2022, 6:05pm UTC](https://forum.arduino.cc/t/codierung-von-10-neopixel-ws2818-stripes-900-leds/985323/3 "2022-04-26T18:05:26Z")

</div>

> [@agmue](#):
>
> 900 Pixel \* 60 mA/Pixel = 54 A entspricht 270 W Netzteil

Die meisten Stripes sind dich am Netzteil und laut dem Berechner dafür ( [https://campofant.com/kabelquerschnitt-leitungsquerschnitt-berechnen/](https://campofant.com/kabelquerschnitt-leitungsquerschnitt-berechnen/) ) vollkommen ausreichend. Die längste Entfernung sind 5 M und da benutze ich 4mm² Kabel, also dürfte das auch reichen.

> [@agmue](#):
>
> Wenn Du die Bestellung noch ändern kannst, rate ich Dir zu WS2815, die werden mit 12 V betrieben und benötigen daher kleinere Ströme, also dünnere Kabel.

Leider hab ich die Kabel alle schon verlegt, aber du hast recht, wäre klüger gewesen auf 12 V zu setzten.

> [@agmue](#):
>
> Da dürfte Dir schnell der Speicher ausgehen, Du brauchst was mit mehr Wumms.

Dann würde ich mir eben den Mega2560 kaufen.

> [@agmue](#):
>
> Ob Adafruit\_NeoPixel zehn Objekte verarbeiten kann, habe ich noch nicht probiert.

Bin mir auch nicht sicher, jedoch habe ich Projekte mit dem Mega2560 gesehen welche 7 Stripes angesteuert haben.  
Bin mir nicht sicher aber ich glaube der ESP32 kann keine 10 PWM Pins steuern.

> [@agmue](#):
>
> Derzeit teuer oder nicht zu bekommen sind Mega2560

Also ich habe hier den Mega2560 auf Amazon gefunden für 18€ [https://www.amazon.de/AZDelivery-ATmega2560-Arduino-kompatibel-gratis/dp/B01MCX1CIN/ref=sr\_1\_5?\_\_mk\_de\_DE=ÅMÅŽÕÑ&crid=1AUU9Q0G7GR8Z&keywords=mega+2560&qid=1650996469&s=computers&sprefix=mega+2560%2Ccomputers%2C68&sr=1-5](https://www.amazon.de/AZDelivery-ATmega2560-Arduino-kompatibel-gratis/dp/B01MCX1CIN/ref=sr_1_5?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=1AUU9Q0G7GR8Z&keywords=mega+2560&qid=1650996469&s=computers&sprefix=mega+2560%2Ccomputers%2C68&sr=1-5)

Kannst du was zu dem Code sagen? Bin mir am Unsichersten darüber, bin nur ein Hobby-Coder ^^

---

<div class="post-metadata">

**Author:** ![wno158](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wno158/32/1014607_2.png) [@wno158](https://forum.arduino.cc/u/wno158)\
**Post date:** [April 26, 2022, 6:44pm UTC](https://forum.arduino.cc/t/codierung-von-10-neopixel-ws2818-stripes-900-leds/985323/4 "2022-04-26T18:44:20Z")

</div>

> [@agmue](#):
>
> Ob Adafruit\_NeoPixel zehn Objekte verarbeiten kann, habe ich noch nicht probiert.

Braucht es gar nicht.  
Jede der Instanzen der Klasse `Strip` hat eine eigene Instanz `strip` der Klasse `Adafruit_NeoPixel`.  
Das sollte gehen.

> [@anonym-user-015](#):
>
> Kannst du was zu dem Code sagen?

Im Rest vom Code sehe ich auf den ersten Blick auch nix, was einem Betrieb im Wege stehen sollte. Ich würde allerdings von diesem Generator (welcher?) erstmal ein Programm für einen kürzeren Streifen auf dem Schreibtisch erstellen lassen und damit mal anfangen - bevor die Zimmerinstallation in Betrieb geht.

> [@anonym-user-015](#):
>
> bin nur ein Hobby-Coder

Sind wir wohl (fast) alle. Ich verdiene jedenfalls meine Brötchen nicht mit Arduinos.

---

<div class="post-metadata">

**Author:** ![anonym-user-015](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@anonym-user-015](https://forum.arduino.cc/u/anonym-user-015)\
**Post date:** [April 26, 2022, 7:05pm UTC](https://forum.arduino.cc/t/codierung-von-10-neopixel-ws2818-stripes-900-leds/985323/5 "2022-04-26T19:05:26Z")

</div>

> [@wno158](#):
>
> diesem Generator (welcher?)

Dieser hier [LED Strip Effects generator](https://adrianotiger.github.io/Neopixel-Effect-Generator/)

> [@wno158](#):
>
> erstmal ein Programm für einen kürzeren Streifen auf dem Schreibtisch erstellen lassen und damit mal anfangen - bevor die Zimmerinstallation in Betrieb geht.

Werde ich machen!

---

<div class="post-metadata">

**Author:** ![HotSystems](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/hotsystems/32/219785_2.png) [@HotSystems](https://forum.arduino.cc/u/HotSystems)\
**Post date:** [April 26, 2022, 7:20pm UTC](https://forum.arduino.cc/t/codierung-von-10-neopixel-ws2818-stripes-900-leds/985323/6 "2022-04-26T19:20:44Z")

</div>

> [@anonym-user-015](#):
>
> Bin mir nicht sicher aber ich glaube der ESP32 kann keine 10 PWM Pins steuern

Das machst du mit normalen, digitalen Pins. Da braucht es keine PWM-Pins.  
Und man könnte es mit einem digitalen Pin erledigen, muss aber nicht.

Auch solltest du die Spannung an den Stripes an mehreren Stellen einspeisen, nicht nur an einer Stelle.

---

<div class="post-metadata">

**Author:** ![agmue](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/agmue/32/750067_2.png) [@agmue](https://forum.arduino.cc/u/agmue)\
**Post date:** [April 26, 2022, 7:25pm UTC](https://forum.arduino.cc/t/codierung-von-10-neopixel-ws2818-stripes-900-leds/985323/7 "2022-04-26T19:25:33Z")

</div>

> [@anonym-user-015](#):
>
> bin nur ein Hobby-Coder

Ich auch.

> [@anonym-user-015](#):
>
> Bin mir nicht sicher aber ich glaube der ESP32 kann keine 10 PWM Pins steuern.

Ich dachte, wir wären uns einig, daß PWM im Pixel gemacht wird. Der µC benötigt dafür keine Hardware-PWM-Pins.

Mega2560: Dein Programm tut was, 5385 Bytes RAM sind noch frei, gemessen in `loop()`.

ESP32: Dein Programm tut was.

In beiden Fällen getestet mit WS2815, ist aber zu WS2812 egal.

> [@anonym-user-015](#):
>
> Dann würde ich mir eben den Mega2560 kaufen.

OK.

> [@anonym-user-015](#):
>
> Dieser hier [LED Strip Effects generator](https://adrianotiger.github.io/Neopixel-Effect-Generator/)

Der kann sehr wenig:  
 ![grafik](https://europe1.discourse-cdn.com/arduino/original/4X/0/c/5/0c5c094493fec49f3e106789618990af0d7f4e53.png)

Das rockt nicht 😉

---

<div class="post-metadata">

**Author:** ![uwefed](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/uwefed/32/213736_2.png) [@uwefed](https://forum.arduino.cc/u/uwefed)\
**Post date:** [April 26, 2022, 7:42pm UTC](https://forum.arduino.cc/t/codierung-von-10-neopixel-ws2818-stripes-900-leds/985323/8 "2022-04-26T19:42:03Z")

</div>

> [@anonym-user-015](#):
>
> In diesem Fall würde ich mir einen Arduino Nano oder Arduino Uno kaufen.

Weder Noch.  
Du hast 900 LEd die teilweise Zusammengelegt sind und so Daten für 725 Neopixel verschickt werden müssen.

Da jedes Neopixel 3Byte Daten braucht, braucht es 2175 Byte RAM. Weder der UNO noch der Nano hat genügend RAM.

Du brauchst schon einen Mega2560 oder einen anderen Controller mit mindestens 4kByte RAM (für die Neopixel, für die Variablen des Sketches und für andere dinge die RAM brauchen).

Grüße Uwe

---

<div class="post-metadata">

**Author:** ![anonym-user-015](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@anonym-user-015](https://forum.arduino.cc/u/anonym-user-015)\
**Post date:** [April 27, 2022, 6:22pm UTC](https://forum.arduino.cc/t/codierung-von-10-neopixel-ws2818-stripes-900-leds/985323/9 "2022-04-27T18:22:51Z")

</div>

> [@agmue](#):
>
> Mega2560: Dein Programm tut was, 5385 Bytes RAM sind noch frei, gemessen in `loop()`.

Danke fürs Testen! hab jetzt den Mega Bestellt.

> [@agmue](#):
>
> Das rockt nicht 😉

Reicht mir ja, es war ja nur sinn das es das kann. Außerdem gibt es auch noch feintuning aber das mache ich dann wenn alles läuft.

> [@uwefed](#):
>
> Du brauchst schon einen Mega2560

Genau den habe ich nun bestellt.

Danke an alle für eure Vorschläge und Berechnungen!

Ich gebe euch ein Update wenn alles Läuft!

---

<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:** [October 24, 2022, 6:23pm UTC](https://forum.arduino.cc/t/codierung-von-10-neopixel-ws2818-stripes-900-leds/985323/10 "2022-10-24T18:23:39Z")

</div>

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