Hi everybody,
Two-fold question: I’ve got 8 NeoPixel strips of 3 pixels each, all on their own PWM pins. I’ve put part of the ColorPalette sketch into the MultipleStripsInOneArray sketch. All the latest software. All on a Mega.
It is doing mostly what I want as long as I don’t run more than 4 of the strips. As soon as I try to load 5 or more in the sketch, all the colors just turn to green and blue. If I only run 4 or less, I get the full rainbow.
#include “FastLED.h”
#define NUM_STRIPS 8
#define NUM_LEDS_PER_STRIP 3
#define NUM_LEDS NUM_LEDS_PER_STRIP * NUM_STRIPS
#define BRIGHTNESS 64
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
CRGBPalette16 currentPalette;
TBlendType currentBlending;
#define UPDATES_PER_SECOND 100
void setup() {
FastLED.addLeds<NEOPIXEL, 2>(leds, 0, NUM_LEDS_PER_STRIP);
FastLED.addLeds<NEOPIXEL, 3>(leds, NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<NEOPIXEL, 4>(leds, 2 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<NEOPIXEL, 5>(leds, 3 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
delay( 3000 ); // power-up safety delay
FastLED.addLeds<LED_TYPE, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.setBrightness( BRIGHTNESS );
currentPalette = RainbowColors_p;
currentBlending = BLEND;
}
void loop() {
static uint8_t startIndex = 0;
startIndex = startIndex + 1; /* motion speed */
FillLEDsFromPaletteColors( startIndex);
FastLED.show();
FastLED.delay(833 / UPDATES_PER_SECOND); // Scroll speed in milliseconds
}
void FillLEDsFromPaletteColors( uint8_t colorIndex)
{
uint8_t brightness = 255;
for( int i = 0; i <3; i++) {
leds[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
colorIndex += 8; // Color segment size
}
for(int i = 3; i < NUM_LEDS-1; i++) {
leds[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
colorIndex += 8; // Color segment size
}
}
The above works, but if I add:
FastLED.addLeds<NEOPIXEL, 8>(leds, 4 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<NEOPIXEL, 9>(leds, 5 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<NEOPIXEL, 10>(leds, 6 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<NEOPIXEL, 11>(leds, 7 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
It goes all green and blue.
Anyone know what gives?
Thanks.