Greetings,
I have a loop of 194 WS2812 LEDS and am trying to make a seamless moving rainbow.
I have created a palette that starts and ends with RED and has rainbow colors evenly spread. but I cannot get the transition from 0 - 194 (NUM_LEDS) to correctly blend.
can anyone help me identify my error please?
#include <FastLED.h>
//FASTLED
#define LEDstripPin 4
#define NUM_LEDS 194
#define COLOR_ORDER GRB
#define CHIPSET WS2812B
int paletteIndex = 0;
CRGB leds[NUM_LEDS];
DEFINE_GRADIENT_PALETTE( Rain_gp ) {
0, 255, 0, 0, //Red
20, 255, 0, 0, //Orange
61, 255, 255, 0, //Yellow
102, 0, 255, 0, //Green
143, 0, 0, 255, //Blue
184, 75,0, 130, //Indego
224, 148,0, 211, //Violet
255, 200, 0, 0}; //Red
CRGBPalette16 Rainbow(Rain_gp);
void setup()
{
FastLED.addLeds<WS2812B,LEDstripPin , GRB>(leds, NUM_LEDS);
fill_solid(leds, NUM_LEDS, CRGB( 0, 0, 0));
FastLED.show();
FastLED.setBrightness(255);
}
void loop()
{
RainbowStrobe();
}
void RainbowStrobe(){ // RAINBOW STROBE
int randomLED = random8(0,NUM_LEDS-1);
fill_palette(leds, NUM_LEDS, paletteIndex,255/NUM_LEDS,Rainbow,255,LINEARBLEND); // 255/NUM_LEDS (led array, number of leds, start index, index delta, palette, brightness, blendtype)
FastLED.show();
EVERY_N_MILLISECONDS(2){
paletteIndex++;
}
FastLED.setBrightness(255);
FastLED.show();
}