4 Stripes lassen sich nicht gleichzeitig nutzen

Hallo zusammen.
Jetzt hab ich wieder so einen Punkt den ich nicht erklären, oder beheben kann.
In dem Sketch sind 4 Stripes angelegt.
Alle tun an sich was sie sollen.
Aber zusammen spielen die nicht.
Je nachdem in welcher Reihenfolge ich die anlege, geht das eine, aber das andere nicht.
Hatte schon deutlich mehr Stripes an einem Controller.
Aber irgendwie scheint hier was anders zu sein.

#include <Adafruit_NeoPixel.h>
#include "Arduino.h"
#include "SoftwareSerial.h"

const byte feathers = 7;
const byte NUM_LEDS = 72, NUM_RING_LEDS = 24;
const byte NUM_LEDs[feathers] = {17, 10, 10, 10, 9, 8, 8};
const byte gamma_steps = 4;
const float gamma_running_lights [] {150, 255, 150, 0};
const byte wing1Pin = 13, wing2Pin = 12, henryPin = 3, kleidPin = 5,
           kleid_motorBPin = 11 , kleid_motorAPin = 10, philPin = 6, aerialingePin = 9,
           nano1Pin = 2, ringPin = A3, ringPin_2 = A2,
           protectors = 1, gelb_rot = 1, blau_gelb = 2, blau_rot = 3,
           gelb_weiss = 4, rot_blau = 5, rot_gelb = 6, Colors = 6;
const byte pins = 6, ledPin[pins] = {3, 5, 6, 9, 10, 11};
const byte brightness_wings = 40, brightness_ring = 40;
bool done [32], play = false, new_pixel = false;
unsigned long lz_count = 0, fade_millis, fade_millis2, fade_count, fade_count2;
enum effekts {
  running_lights_Val, running_lights_speed_Val, meteor_Val,
  meteor_interVal, fc_Val, fireFade_Val, fire_Val, spk_Val, sharp_Val,
  rainbow_Val, rainbow_fade_in_Val, rainbow_fade_out_Val, rainbow_speed_Val
};
int16_t fc_val, running_lights_val, sharp_val, fire_fade_val, fire_val, meteor_val,
        meteor_Interval, running_lights_speed_val, spk_val, rainbow_val,
        rainbow_fade_in_val, rainbow_fade_out_val, rainbow_speed_val;
byte fire_end[feathers];
byte sparkles_value[NUM_LEDS];
bool sparkles_fade[NUM_LEDS], sparkles_on;
byte meteor_value[NUM_LEDS], meteor_fo[NUM_LEDS], meteor_on;
bool meteor_on_feather[feathers] = {0, 0, 0, 0, 0, 0, 0}, meteor_fade[NUM_LEDS], meteor_safe;
unsigned long meteor_time[feathers] = {0, 0, 0, 0, 0, 0, 0};
unsigned long meteor_safe_time[feathers] = {0, 0, 0, 0, 0, 0, 0};
byte wing_color;
bool pixel[NUM_LEDS];
bool pixel_2[NUM_LEDS];
const byte wing[feathers][17] = {
  {0, 1, 2, 3, 4, 5, 6, 7, 16, 25, 26, 36, 37, 38, 49, 60, 61},
  {62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0},
  {50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, 0, 0, 0, 0, 0},
  {39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 0, 0, 0, 0, 0, 0, 0},
  {27, 28, 29, 30, 31, 32, 33, 34, 35, 0, 0, 0, 0, 0, 0, 0, 0},
  {17, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0, 0, 0},
  {8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0}
};
const byte wing_2[feathers][17] = {
  {0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 26, 27, 37, 38, 49, 50, 61},
  {62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0},
  {51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 0, 0, 0, 0, 0, 0, 0},
  {39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 0, 0, 0, 0, 0, 0, 0},
  {28, 29, 30, 31, 32, 33, 34, 35, 36, 0, 0, 0, 0, 0, 0, 0, 0},
  {18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 0, 0},
  {8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0}
};

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, wing1Pin, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip_2 = Adafruit_NeoPixel(NUM_LEDS, wing2Pin, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel ring_1 = Adafruit_NeoPixel(NUM_RING_LEDS, ringPin, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel ring_2 = Adafruit_NeoPixel(NUM_RING_LEDS, ringPin_2, NEO_GRB + NEO_KHZ800);

void setup() {

  for (int i = 0; i < pins; i++) {
    pinMode(ledPin[i], OUTPUT);
  }
  pinMode(nano1Pin, INPUT);
  Serial.begin(9600);
  delay(10);
  reSet(0);
  wing_color = random(1, Colors);
  randomSeed(analogRead(6));
  strip.begin();
  strip.setBrightness(brightness_wings);
  strip.show();
  strip_2.begin();
  strip_2.setBrightness(brightness_wings);
  strip_2.show();
  ring_1.begin();
  ring_1.setBrightness(brightness_ring);
  ring_1.show();
  ring_2.begin();
  ring_2.setBrightness(brightness_ring);
  ring_2.show();
}

void loop() {

  if (new_pixel) {
    play = digitalRead(nano1Pin);
    strip.show();
    strip_2.show();
    ring_1.show();
    ring_2.show();
    strip.clear();
    strip_2.clear();
    ring_1.clear();
    ring_2.clear();
    setMillis();
    new_pixel = false;
  }
  unsigned long fps_millis = millis();
  static unsigned long fps_count;
  if (fps_millis - fps_count > 1000 / 24) {
    new_pixel = true;
    fps_count = fps_millis;
  }
  if (play) {
    protect();
  } else {
    reSet(0);
    no_track();
    if (running_lights_val == 0 && sharp_val == 0) wing_color = random(1, Colors);
    lz_count = millis();
  }
  if (sharp_val > 0)sharpen(sharp_val, wing_color);
  for (byte i = 0; i < feathers; i++) {
    if (meteor_on_feather[i] || meteor_val > 0) {
      if (!meteor_safe) {
        meteor_safe = !meteor_safe;
        for (byte i = 0; i < feathers; i++) {
          meteor_time[i] = millis() - meteor_safe_time[i];
        }
      }
      meteor(meteor_val, meteor_Interval);
    }
  }
  if (meteor_on == 0 && meteor_safe && meteor_val <= 0) {
    meteor_safe = !meteor_safe;
    for (byte i = 0; i < feathers; i++) {
      meteor_safe_time[i] = millis() - meteor_time[i];
    }
  }
  if (spk_val > 0) sparkles(spk_val);
  if (fire_val > 0) {
    fire();
  } else {
    for (byte i = 0; i < feathers; i++) {
      fire_end[i] = 0;
    }
  }
  if (rainbow_val > 0) rainbow();
  if (running_lights_val > 0) {
    running_lights(running_lights_val, wing_color, running_lights_speed_val);
  }
  for (byte i = 0; i < NUM_LEDS; i++) {
    pixel[i] = false;
    pixel_2[i] = false;
  }
}

void protect() {

  fade_millis = millis();
  if (fade_millis - fade_count > 100) {
    fx(running_lights_speed_Val, 150, 0, 0, 0, 1);        //effekt, intens, Min, Sek in millis, fade zeit 0-50, timeline nummer
    fx(running_lights_Val, 128, 0, 0, 50, 2);
    fx(fc_Val, 140, 0, 0, 0, 3);
    fx(sharp_Val, 255, 0, 12170, 10, 4);
    fx(fc_Val, 255, 1, 31086, 10, 5);
    fx(running_lights_Val, 255, 1, 31086, 1, 6);
    fx(running_lights_Val, 0, 1, 31309, 40, 7);
    fx(meteor_interVal, 255, 1, 31319, 0, 8);
    fx(meteor_Val, 10, 1, 31319, 0, 9);
    fx(fire_Val, 128, 1, 55460, 0, 10);
    fx(fireFade_Val, 255, 1, 56070, 10, 11);
    fx(sharp_Val, 0, 1, 55460, 10, 12);
    fx(spk_Val, 0, 1, 56240, 10, 13);
    fx(meteor_Val, 0, 1, 56350, 0, 15);
    fx(spk_Val, 10, 2, 1642, 10, 16);
    fx(meteor_Val, 75, 2, 1976, 0, 17);
    fx(spk_Val, 200, 2, 12415, 0, 18);
    fx(meteor_Val, 200, 2, 12468, 0, 19);
    fx(running_lights_Val, 128, 2, 15427, 0, 20);
    fx(fc_Val, 140, 2, 15427, 0, 21);
    fx(fireFade_Val, 0, 2, 15881, 10, 22);
    fx(sharp_Val, 255, 2, 15881, 10, 23);
    fx(meteor_Val, 75, 2, 16058, 0, 24);
    fx(spk_Val, 10, 2, 16058, 10, 25);
    fx(fire_Val, 0, 2, 16881, 0, 26);
    fx(fc_Val, 255, 2, 41785, 10, 27);
    fx(running_lights_Val, 255, 2, 41785, 10, 28);
    fx(meteor_Val, 25, 2, 41996, 30, 29);
    fx(spk_Val, 5, 2, 41996, 10, 30);
    fx(sharp_Val, 0, 2, 41996, 40, 31);
    fx(running_lights_Val, 0, 2, 42234, 50, 32);
    fade_count = fade_millis;
  }
  fade_millis2 = millis();
  if (fade_millis2 - fade_count2 > 10) {
    star(1);
    henry(1);
    phil(1);
    aerial_inge(1);
    kleid(1);
    kleid_motor(1);
    fade_count2 = fade_millis2;
  }
}

void no_track() {

  fade_millis = millis();
  if (fade_millis - fade_count > 100) {
    //fx(running_lights_speed_Val, 150, 0, 0, 0, 0); //effekt, intens, Min, MilliSec, fade dauer, nummer
    fx(running_lights_Val, 0, 0, 0, 40, 0);
    //fx(fc_Val, 140, 0, 0, 0, 0);
    fx(meteor_Val, 0, 0, 0, 40, 0);
    //fx(meteor_interVal, 255, 0, 0, 0, 0);
    fx(fire_Val, 0, 0, 0, 40, 0);
    fx(fireFade_Val, 0, 0, 0, 20, 0);
    fx(sharp_Val, 0, 0, 0, 30, 0);
    fx(spk_Val, 10, 0, 0, 30, 0);
    fx(rainbow_Val, 0, 0, 0, 30, 0);
    fx(rainbow_fade_in_Val, 0, 0, 0, 30, 0);
    //fx(rainbow_fade_out_Val, 0, 0, 0, 0, 0);
    //fx(rainbow_speed_Val, 140, 0, 0, 0, 0);
    fade_count = fade_millis;
  }
  fade_millis2 = millis();
  if (fade_millis2 - fade_count2 > 10) {
    star(0);
    henry(1);
    phil(1);
    aerial_inge(1);
    kleid(1);
    kleid_motor(0);
    fade_count2 = fade_millis2;
  }
}

void fx(effekts effekt, byte intens, byte Min, unsigned long Sec, byte dauer, int number) {

  static unsigned long timer = 0;
  unsigned long timer_millis =  millis();
  timer = (Min * 60000) + (Sec);
  if (timer_millis - lz_count > timer) {
    if (!done [number] || number == 0) {
      if (effekt == sharp_Val)  done[number] = fade(sharp_val, intens, dauer);
      if (effekt == running_lights_Val)  done[number] = fade(running_lights_val, intens, dauer);
      if (effekt == fc_Val)  done[number] = fade(fc_val, intens, dauer);
      if (effekt == meteor_Val)  done[number] = fade(meteor_val, intens, dauer);
      if (effekt == meteor_interVal)  done[number] = fade(meteor_Interval, intens, dauer);
      if (effekt == spk_Val)  done[number] = fade(spk_val, intens, dauer);
      if (effekt == rainbow_Val)  done[number] = fade(rainbow_val, intens, dauer);
      if (effekt == rainbow_fade_in_Val)  done[number] = fade(rainbow_fade_in_val, intens, dauer);
      if (effekt == rainbow_fade_out_Val)  done[number] = fade(rainbow_fade_out_val, intens, dauer);
      if (effekt == rainbow_speed_Val)  done[number] = fade(rainbow_speed_val, intens, dauer);
      if (effekt == running_lights_speed_Val) done[number] = fade(running_lights_speed_val, intens, dauer);
      if (effekt == fire_Val)  done[number] = fade(fire_val, intens, dauer);
      if (effekt == fireFade_Val)  done[number] = fade(fire_fade_val, intens, dauer);
    }
  }
}

bool fade(int &var, byte wert, byte var_Speed) {

  byte var_speed = map(var_Speed, 1, 50, 50, 1);
  bool fade_done = false;
  if (var_speed > 0) {
    if (var <= wert - var_speed) {
      var += var_speed;
    } else if (var >= wert + var_speed) {
      var -= var_speed;
    } else {
      var = wert;
      fade_done = true;
    }
  } else {
    var = wert;
    fade_done = true;
  }
  return fade_done;
}

void star(bool an) {

  static bool dir = true;
  static bool direct_change = true;
  static unsigned long ringtime;
  static unsigned long stoptime;
  static unsigned long ringdir_time;
  static unsigned long speed_change;
  static int ringdir_runtime = 15000;
  static byte ring_speed = 32;
  static unsigned int speed_change_time = 1000;
  static byte ring_minspeed = 112;
  static byte ring_fademax = 150;
  static byte ring_fadecount = ring_fademax / 3;
  static byte ringspeed = ring_minspeed;
  static byte shift;
  static byte value;
  unsigned long ring_millis = millis();

  if (ring_millis - ringtime > ringspeed) {
    if (an) {
      if (ring_millis < ringdir_time + ringdir_runtime) {
        if (ring_millis - speed_change > speed_change_time) {
          ring_speed = random(16, 32);
          speed_change = ring_millis;
        }
        if (ringspeed > ring_speed) ringspeed -= (ringspeed / 16);
        if (ringspeed < ring_speed) ringspeed += (ringspeed / 16);
        direct_change = true;
      } else {
        if (ringspeed < ring_minspeed) {
          ringspeed += (ringspeed / 16);
          stoptime = ring_millis;
        }
        if (direct_change && ringspeed >= ring_minspeed) {
          if (ring_millis - stoptime > 350) {
            dir = !dir;
            direct_change = false;
            ringdir_runtime = random(5000, 10000);
            ringdir_time = ring_millis;
          }
        }
      }
    } else {
      if (ringspeed < ring_minspeed) {
        ringspeed += (ringspeed / 16);
      }
      direct_change = false;
      ringdir_runtime = random(5000, 10000);
      ringdir_time = ring_millis;
    }
    if (ringspeed < ring_minspeed) {
      if (shift >= ring_fadecount) {
        shift -= ring_fadecount;
      } else {
        shift = ring_fademax;
      }
      ringtime = ring_millis;
    }
  }
  value = shift;
  for (byte i = 0; i < NUM_RING_LEDS; i++) {
    if (value == ring_fademax) value = 255;
    if (dir) {
      ring_1.setPixelColor(i, ring_1.Color(value, value, value));
      ring_2.setPixelColor(NUM_RING_LEDS - 1 - i, ring_2.Color(value, value, value));
    } else {
      ring_1.setPixelColor(NUM_RING_LEDS - 1 - i, ring_1.Color(value, value, value));
      ring_2.setPixelColor(i, ring_2.Color(value, value, value));
    }
    //Serial.println(value);
    if (value == 255) value = ring_fademax;
    if (value >= ring_fadecount) {
      value -= ring_fadecount;
    } else {
      value = ring_fademax;
    }
  }
}

void henry(bool an) {

  if (an) analogWrite(henryPin, random(127, 255));
  if (!an)digitalWrite(henryPin, LOW);
}

void kleid(bool an) {

  if (an) analogWrite(kleidPin, random(127, 230));
  if (!an)digitalWrite(kleidPin, LOW);
}

void phil(bool an) {

  if (an) analogWrite(philPin, random(127, 230));
  if (!an)digitalWrite(philPin, LOW);
}

void aerial_inge(bool an) {

  if (an) analogWrite(aerialingePin, random(127, 255));
  if (!an)digitalWrite(aerialingePin, LOW);
}

void kleid_motor(bool an) {

  static bool dir = true;
  static bool direct_change = true;
  static unsigned long kleid_motor_time;
  unsigned long kleid_motor_millis = millis();
  static int kleid_motor_runtime = 15000;
  if (an) {
    if (kleid_motor_millis < kleid_motor_time + kleid_motor_runtime) {
      digitalWrite(kleid_motorAPin, dir);
      digitalWrite(kleid_motorBPin, !dir);
      direct_change = true;
    } else {
      if (direct_change) {
        dir = !dir;
        direct_change = false;
        kleid_motor_runtime = random(12000, 24000);
        kleid_motor_time = kleid_motor_millis - 1000;
      }
      digitalWrite(kleid_motorAPin, LOW);
      digitalWrite(kleid_motorBPin, LOW);
    }
  }
  if (!an) {
    digitalWrite(kleid_motorAPin, LOW);
    digitalWrite(kleid_motorBPin, LOW);
  }
}

void reSet(unsigned long p_reSet) {

  unsigned long reSet_millis = millis();
  if (reSet_millis - lz_count > p_reSet) {
    play = false;
    //Serial.println("reSet");
    for (unsigned int i = 0; i < sizeof(done); i++) {
      done[i] = false;
    }
  }
}

//----------running_lights--------------------------
void running_lights(byte running_lights_intens, byte running_lights_color, byte running_lights_speed) {

  static unsigned long running_lights_time;
  static byte Pixel;
  static byte running_lights_run;
  static float running_lightsred;
  static float running_lightsgreen;
  static float running_lightsblue;
  unsigned long running_lights_millis = millis();
  int bl_speed;
  float value = running_lights_intens;
  static byte running_lights_red, running_lights_green, running_lights_blue;
  if (running_lights_speed > 127) bl_speed = map(running_lights_speed, 128, 255, 200, 30);
  if (running_lights_speed <= 127) bl_speed = map(running_lights_speed, 0, 127, 30, 200);
  if (running_lights_color == 1 || running_lights_color == 4) {
    running_lights_red = 170;
    running_lights_green = 128;
    running_lights_blue = 0;
  }
  if (running_lights_color == 2 || running_lights_color == 3) {
    running_lights_red = 0;
    running_lights_green = 0;
    running_lights_blue = 170;
  }
  if (running_lights_color == 5 || running_lights_color == 6) {
    running_lights_red = 170;
    running_lights_green = 0;
    running_lights_blue = 0;
  }
  for (byte j = 0; j < feathers; j++) {
    byte rl_fade = NUM_LEDs[j];
    if (fire_end[j] > 0) rl_fade = NUM_LEDs[j] - fire_end[j];
    for (byte i = 0; i <= rl_fade; i++) {
      running_lightsred = running_lights_red * (intensity(Pixel) / 255) * (value / 255);
      running_lightsgreen = running_lights_green * (intensity(Pixel) / 255) * (value / 255);
      running_lightsblue = running_lights_blue * (intensity(Pixel) / 255) * (value / 255);
      if (!pixel[wing[j][NUM_LEDs[j] - i]] && new_pixel) strip.setPixelColor(wing[j][NUM_LEDs[j] - i], strip.Color(running_lightsred, running_lightsgreen, running_lightsblue));
      if (!pixel_2[wing_2[j][NUM_LEDs[j] - i]] && new_pixel)strip_2.setPixelColor(wing_2[j][NUM_LEDs[j] - i], strip_2.Color(running_lightsred, running_lightsgreen, running_lightsblue));
      Pixel == gamma_steps - 1 ? Pixel = 0 : Pixel++;
      pixel[wing[j][NUM_LEDs[j] - i]] = true;
      pixel_2[wing_2[j][NUM_LEDs[j] - i]] = true;
    }
  }
  if (running_lights_speed > 127) {
    Pixel = gamma_steps - 1 - running_lights_run;
    if (running_lights_run < gamma_steps) {
      if (running_lights_millis - bl_speed > running_lights_time) {
        running_lights_run ++;
        running_lights_time = running_lights_millis;
      }
    }
    if (running_lights_run == gamma_steps) running_lights_run = 0;
  }
  if (running_lights_speed <= 127) {
    Pixel = gamma_steps - running_lights_run;
    if (running_lights_run > 0) {
      if (running_lights_millis - bl_speed > running_lights_time) {
        running_lights_run --;
        running_lights_time = running_lights_millis;
      }
    }
    if (running_lights_run == 0) running_lights_run = gamma_steps;
  }
}
float intensity(byte Pixel) {

  static float value;
  value = gamma_running_lights[Pixel] > fc_val ? gamma_running_lights[Pixel] : fc_val;
  return value;
}

//----------rainbow---------------------
void rainbow() {

  byte value = map(rainbow_val, 6, 255, 24, 255);
  int rgb_speed = map(rainbow_speed_val, 0, 255, -3000, 3000);
  static uint32_t firstPixelHue = 0;
  byte fade_in = map(rainbow_fade_in_val, 0, 255, 0, NUM_LEDS);
  byte fade_out = map(rainbow_fade_out_val, 0, 255, 0, NUM_LEDS);
  //if (fade_out < fire_end) fade_out = fire_end;
  static byte NUMLEDS;
  NUMLEDS = NUM_LEDS;
  for (unsigned int Pixel = fade_out; Pixel < fade_in; Pixel++) {
    int pixelHue = firstPixelHue + (Pixel * 65536L / NUMLEDS);
    if (!pixel[Pixel] && new_pixel) strip.setPixelColor(Pixel, strip.gamma32(strip.ColorHSV(pixelHue, 255, value)));
    if (!pixel_2[Pixel] && new_pixel) strip_2.setPixelColor(Pixel, strip_2.gamma32(strip_2.ColorHSV(pixelHue, 255, value)));
  }
  firstPixelHue += rgb_speed;
}

//------------fire----------------------
void fire() {

  static unsigned long fire_time = 0;
  static byte fire_timer = 120;
  static byte heat[NUM_LEDS];
  static byte cooldown[NUM_LEDS];
  static byte spark[feathers];
  byte fire_fade[feathers];
  int Cooling;
  int Sparking;
  unsigned long fire_millis = millis();
  for (byte feather = 0; feather < feathers; feather++) {
    fire_fade[feather] = map(fire_fade_val, 0, 255, 0, NUM_LEDs[feather]);
    if (feather < 1) {
      Cooling = 0;
      Sparking = 255;
    } else {
      Cooling = 155;
      Sparking = 150;
    }
    if (fire_millis - fire_time > fire_timer) {
      for ( int Pixel = 5; Pixel < fire_fade[feather]; Pixel++) {
        cooldown[Pixel] = random(0, ((Cooling * 10) / fire_fade[feather]) + 2);
        heat[wing[feather][Pixel]] = cooldown[Pixel] > heat[wing[feather][Pixel]] ? 0 : heat[wing[feather][Pixel]] - cooldown[Pixel];
      }
      for ( int Pixel = fire_fade[feather] - 1; Pixel >= 2; Pixel--) {
        heat[wing[feather][Pixel]] = (heat[wing[feather][Pixel - 1]] + heat[wing[feather][Pixel - 2]] + heat[wing[feather][Pixel - 2]]) / 3;
      }
      if ( random(255) < Sparking ) {
        spark[feather] = random(7);
        heat[wing[feather][spark[feather]]] = heat[wing[feather][spark[feather]]] + random(160, 255);
      }
      if (feather == feathers - 1) fire_time = fire_millis;
    }
    for ( int Pixel = 0; Pixel < fire_fade[feather]; Pixel++) {
      setPixelHeatColor(feather, Pixel, heat[wing[feather][Pixel]] );
    }
    fire_end[feather] = fire_fade[feather];
  }
}
void setPixelHeatColor (byte feather, byte Pixel, byte temperature) {
  float value = fire_val;
  byte temp = round((temperature / 255.0) * 191);
  byte heatramp = temp & 63;
  heatramp <<= 2;
  if ( temp > 128) {
    if (!pixel[wing[feather][Pixel]] && new_pixel) strip.setPixelColor(wing[feather][Pixel], 255 * (value / 255), 255 * (value / 255), heatramp * (value / 255), 0);
    if (!pixel_2[wing_2[feather][Pixel]] && new_pixel) strip_2.setPixelColor(wing_2[feather][Pixel], 255 * (value / 255), 255 * (value / 255), heatramp * (value / 255), 0);
  } else if ( temp > 64 ) {
    if (!pixel[wing[feather][Pixel]] && new_pixel) strip.setPixelColor(wing[feather][Pixel], 255 * (value / 255), heatramp * (value / 255), 0);
    if (!pixel_2[wing_2[feather][Pixel]] && new_pixel) strip_2.setPixelColor(wing_2[feather][Pixel], 255 * (value / 255), heatramp * (value / 255), 0);
  } else {
    if (!pixel[wing[feather][Pixel]] && new_pixel) strip.setPixelColor(wing[feather][Pixel], heatramp * (value / 255), 0, 0);
    if (!pixel_2[wing_2[feather][Pixel]] && new_pixel) strip_2.setPixelColor(wing_2[feather][Pixel], heatramp * (value / 255), 0, 0);
  }
  pixel[wing[feather][Pixel]] = true;
  pixel_2[wing_2[feather][Pixel]] = true;
}

//----------sharpen--------------------------
void sharpen (byte sharp_intens, byte sharp_color) {

  static byte sharp_red, sharp_green, sharp_blue;
  if (sharp_color == 1 || sharp_color == 3) {
    sharp_red = sharp_intens;
    sharp_green = 0;
    sharp_blue = 0;
  }
  if (sharp_color == 2 || sharp_color == 6) {
    sharp_red = sharp_intens;
    sharp_green = sharp_intens;
    sharp_blue = 0;
  }
  if (sharp_color == 5) {
    sharp_red = 0;
    sharp_green = 0;
    sharp_blue = sharp_intens;
  }
  if (sharp_color == 4) {
    sharp_red = sharp_intens;
    sharp_green = sharp_intens;
    sharp_blue = sharp_intens;
  }
  for (byte i = 1; i < feathers; i++) {
    if (!pixel[wing[i][NUM_LEDs[i] - 1]] && new_pixel) strip.setPixelColor(wing[i][NUM_LEDs[i] - 1], sharp_red, sharp_green, sharp_blue);
    if (!pixel_2[wing_2[i][NUM_LEDs[i] - 1]] && new_pixel) strip_2.setPixelColor(wing_2[i][NUM_LEDs[i] - 1], sharp_red, sharp_green, sharp_blue);
    pixel[wing[i][NUM_LEDs[i] - 1]] = true;
    pixel_2[wing_2[i][NUM_LEDs[i] - 1]] = true;
  }
}

//----------sparkles--------------------------
void sparkles(byte sparkles_intens) {

  static unsigned long sparkles_zeit;
  static unsigned long sparkles_fadetime;
  static unsigned long sparkles_start;
  unsigned long sparkles_millis = millis();
  byte fade_count = 0;
  byte Pixel = random(NUM_LEDS);
  int value = map(sparkles_intens, 1, 255, 500, 0);;
  byte value_fo = map(sparkles_intens, 1, 255, 6, 200);;

  if (sparkles_millis - value_fo > sparkles_fadetime) {
    for (byte Pixel_fade = 0; Pixel_fade < NUM_LEDS; Pixel_fade++) {
      byte pixelfade;
      if (sparkles_value[Pixel_fade] > 12) {
        sparkles_value[Pixel_fade] -= 12;
      } else {
        sparkles_value[Pixel_fade] = 0;
        sparkles_fade[Pixel_fade] = false;
      }
      pixelfade = sparkles_value[Pixel_fade];
      if (sparkles_fade[Pixel_fade]) {
        if (!pixel[Pixel_fade] && new_pixel) strip.setPixelColor(Pixel_fade, pixelfade, pixelfade, pixelfade);
        if (!pixel_2[Pixel_fade] && new_pixel) strip_2.setPixelColor(Pixel_fade, pixelfade, pixelfade, pixelfade);
        pixel[Pixel_fade] = true;
        pixel_2[Pixel_fade] = true;
      }
      fade_count += sparkles_fade[Pixel_fade];
    }
    sparkles_on = fade_count > 0 ? true : false;
    sparkles_fadetime = sparkles_millis;
  } else {
    for (byte Pixel_fade = 0; Pixel_fade < NUM_LEDS; Pixel_fade++) {
      if (sparkles_fade[Pixel_fade]) {
        if (!pixel[Pixel_fade] && new_pixel) strip.setPixelColor(Pixel_fade, sparkles_value[Pixel_fade], sparkles_value[Pixel_fade], sparkles_value[Pixel_fade]);
        if (!pixel_2[Pixel_fade] && new_pixel) strip_2.setPixelColor(Pixel_fade, sparkles_value[Pixel_fade], sparkles_value[Pixel_fade], sparkles_value[Pixel_fade]);
        pixel[Pixel_fade] = true;
        pixel_2[Pixel_fade] = true;
      }
    }
  }
  if (sparkles_millis - sparkles_zeit > sparkles_start) {
    if (!pixel[Pixel] && new_pixel) strip.setPixelColor(Pixel, 0xffffff);
    if (!pixel_2[Pixel] && new_pixel) strip_2.setPixelColor(Pixel, 0xffffff);
    pixel[Pixel] = true;
    pixel_2[Pixel] = true;
    sparkles_value[Pixel] = 255;
    sparkles_fade[Pixel] = true;
    sparkles_start = random(0, value);
    sparkles_zeit = sparkles_millis;
  }
}

//----------meteor---------------------
void meteor(byte speed_meteor, byte interval_meteor) {

  static unsigned long meteor_time_on[] = {0, 500, 1200, 1600, 200, 2000, 800};
  static unsigned long meteor_fadetime;
  static byte meteor_incr[] = {0, 0, 0, 0, 0, 0, 0};
  static byte meteor_interval_safe;
  unsigned long meteor_millis = millis();
  int fade_count[] = {0, 0, 0, 0, 0, 0, 0};
  static bool meteor_done[] = {0, 0, 0, 0, 0, 0, 0};
  byte meteor_speed = map(speed_meteor, 1, 255, 150, 8);
  byte meteor_interval = map(interval_meteor, 0, 255, 1, 20);
  if (meteor_millis - (meteor_speed) > meteor_fadetime) {
    for ( byte i = 0; i < feathers; i++) {
      if (meteor_on_feather[i]) {
        for (byte Pixel = 0; Pixel < NUM_LEDs[i]; Pixel++) {
          if (meteor_fade[wing[i][Pixel]]) {
            meteor_value[wing[i][Pixel]] = meteor_fadeout(wing[i][Pixel]);
            if (!pixel[wing[i][Pixel]] && new_pixel) strip.setPixelColor(wing[i][Pixel] , meteor_value[wing[i][Pixel]], meteor_value[wing[i][Pixel]], meteor_value[wing[i][Pixel]]);
            if (!pixel_2[wing_2[i][Pixel]] && new_pixel) strip_2.setPixelColor(wing_2[i][Pixel] , meteor_value[wing[i][Pixel]], meteor_value[wing[i][Pixel]], meteor_value[wing[i][Pixel]]);
            pixel[wing[i][Pixel]] = true;
            pixel_2[wing_2[i][Pixel]] = true;
          }
          fade_count[i] += meteor_fade[wing[i][Pixel]];
        }
        if (!meteor_done[i]) {
          if (!pixel[wing[i][meteor_incr[i]]] && new_pixel) strip.setPixelColor( wing[i][meteor_incr[i]] , 0xffffff);
          if (!pixel_2[wing_2[i][meteor_incr[i]]] && new_pixel) strip_2.setPixelColor( wing_2[i][meteor_incr[i]] , 0xffffff);
          if (meteor_incr[i] < NUM_LEDs[i]) {
            pixel[wing[i][meteor_incr[i]]] = true;
            pixel_2[wing_2[i][meteor_incr[i]]] = true;
            meteor_fade[wing[i][meteor_incr[i]]] = true;
            meteor_value[wing[i][meteor_incr[i]]] = 255;
            meteor_fo[wing[i][meteor_incr[i]]] = random(3, 100);
          }
        }
        if (meteor_incr[i] < NUM_LEDs[i] - 1) {
          meteor_incr[i] ++;
        } else {
          meteor_incr[i] = 0;
          meteor_done[i] = true;
          if (!fade_count[i]) {
            meteor_time[i] = meteor_millis;
            meteor_time_on[i] = random(4000 / meteor_interval, 13000 / meteor_interval);
            if (meteor_val > 0) meteor_done[i] = false;
            meteor_on_feather[i] = false;
            meteor_interval_safe = meteor_interval;
          }
        }
      } else {
        if (meteor_interval_safe != meteor_interval) {
          meteor_time[i] = meteor_millis;
          meteor_time_on[i] = random(4000 / meteor_interval, 17000 / meteor_interval);
          meteor_interval_safe = meteor_interval;
        }
      }
      if (meteor_millis - meteor_time[i] > meteor_time_on[i]) {
        meteor_on_feather[i] = true;
      }

      meteor_fadetime = meteor_millis;
    }
  } else {
    for (byte feather = 0; feather < feathers; feather++) {
      for (byte Pixel = 0; Pixel < NUM_LEDs[feather]; Pixel++) {
        if (meteor_fade[wing[feather][Pixel]]) {
          if (!pixel[wing[feather][Pixel]] && new_pixel) strip.setPixelColor(wing[feather][Pixel] , meteor_value[wing[feather][Pixel]], meteor_value[wing[feather][Pixel]], meteor_value[wing[feather][Pixel]]);
          if (!pixel_2[wing_2[feather][Pixel]] && new_pixel) strip_2.setPixelColor(wing_2[feather][Pixel] , meteor_value[wing[feather][Pixel]], meteor_value[wing[feather][Pixel]], meteor_value[wing[feather][Pixel]]);
          pixel[wing[feather][Pixel]] = true;
          pixel_2[wing_2[feather][Pixel]] = true;
        }
      }
    }
  }
}
byte meteor_fadeout(byte Pixel) {
  if (meteor_value[Pixel] > meteor_fo[Pixel]) {
    meteor_value[Pixel] -= meteor_fo[Pixel];
  } else {
    meteor_value[Pixel] = 0;
    meteor_fade[Pixel] = false;
  }
  return meteor_value[Pixel];
}

extern volatile unsigned long timer0_millis;
void setMillis()
{
  static uint32_t zaehler = 0;
  unsigned long myMillis = 0;
  if (zaehler < 4)
  {
    myMillis = millis() + 2;
  }
  else
  {
    myMillis = millis() + 3;
    zaehler = 0;
  }
  byte sreg = SREG; // sichert das Statusregister
  cli(); // deaktiviert Interrupts (im Statusregister)
  timer0_millis = myMillis;  // setzt timer0 mit Übergabewert
  SREG = sreg; // Statusregister wieder zurückstellen
  sei();
  zaehler++;
}

2 * 24 + 2 * 72 ist nicht soo viel, deine Beschreibung klingt trotzdem nach einem RAM Problem...

Hab ich auch schon vermutet mit den ganzen arrays im Sketch.
Aber laut ide sinds nur 70%.
Normal hatte ich wenigstens ne Warnung das der Speicher knapp werden könnte.
Verteil ich den Sketch aber aber auf 2 Nanos geht jeder für sich ohne Probleme.

Frage an die Adafruit_NeoPixel - Experten: Sieht man deren RAM Bedarf in der IDE?
Oder legt sie nennenswert Daten lokal / im heap ab?

kein Experte.

Aber, nein siehst nicht an den Globals.

Mustersketch simple:

#define NUMPIXELS 16 // --> 2452/41
#define NUMPIXELS 500 // --> 2452/41

malloc(numBytes)


Gibt es einen Grund, warum die Stripes global angelegt werden müssen?
Die Instanzen können auch local existieren, die Klasse ist RAII konform

Wenn ich das richtig verstehe gibt mir malloc() die Größe eines Arrays zurück.
Wie komm ich dann auf meinen Gesamtbedarft?
Und wie meinst du das mit local?
Die Stripes werden ja von den meisten Funktionen verwendet. Da muß ich ja auch global definieren, oder?

Ja: Wenn der RAM sowieso gebraucht wird, hätte man die Chance, zu merken dass er nicht reicht.

Aber wenn die lib malloc(numBytes) macht und den Fehler ignoriert, oder man als Benutzer den Fehler ignoriert, hat man eben Pech.

Die Libc Doku würde dir sagen, dass malloc() einen Zeiger auf den reservierten Bereich zurückgibt.

Das kann ich dir nicht sagen, ob das "muss".

Aber:
Eins muss ja klar sein, wenn der Speicher nicht reicht, dann muss man etwas am Konzept so verändern, dass man mit weniger auskommt.
Oder einen anderen µC nehmen.

Das tut sie.
Das tut sie nicht.
Sie ignoriert allerdings sämtlich Pixelveränderungen, welche außerhalb des reservierten Bereiches liegen. Und das sind eben ALLE, wenn malloc() nicht liefern konnte

Das sagt mir die Doku, ich weiß aber nicht wie ich damit genau arbeiten kann um meinen Ram des kompletten Sketches heraus zu kriegen.
Das ich dann auf was ausweichen muß ist klar.
Aber hab ich ein RAM Problem?

Suchtipp: Arduino Measuring Memory Usage

Dass die Stripe Instanz global sein muss?
Wo?

Nein, dass malloc() einen Zeiger auf den reservierten Bereich zurückgibt.
Aber ich find nur Beispiele mit arrays.
Und du brauchst nicht glauben, das ich nicht schon gesucht habe, bevor ich hier was poste.
Ich find nur nix bei dem der Groschen fällt.

Auf einem UNO-gebranntem 328:


int freeRam()
  {
  extern int __heap_start, *__brkval;
  int v;
  return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
  }

gibt bei Einsatz:

void loop() {
Serial.println(freeRam());
  if (new_pixel) {

97
aus.

Aber ich erinner mich auch:

und ich bin wieder weg.

Beispiele zeigen selten ALLE Möglichkeiten.

Hier mal ein Lauflicht mit einer lokalen Instanz.
(aus einem meiner Wühlkistenprogramme raus operiert und getestet)

#include <TaskMacro.h> // findest du hier im Forum
#include <Adafruit_NeoPixel.h>

const byte NUM_LEDS = 40;
const byte pin = 6;




Task lauflicht()
{
  static unsigned i;
  
  taskBegin();
  while(1)
  {
    for(i = 0; i < NUM_LEDS; i++)
    {
        taskPause(100);
        {
          Adafruit_NeoPixel strip  {NUM_LEDS, pin, NEO_GRB + NEO_KHZ800};
          strip.begin();
          strip.setPixelColor(i,strip.Color(0, 0, 255));
          strip.show();
       }
    }   
  }
  taskEnd();
}





void setup()
{
}

void loop()
{
  lauflicht();
}

Wenn es auch nicht unmittelbar deine Lösung ist, könnte es dir doch bei dem Groschen helfen.