// https://www.reddit.com/r/FastLED/comments/1glyqbu/i_cant_use_more_than_255_leds_on_my_strip_of_300/
#include <FastLED.h>
#define NUM_LEDS 300
#define LED_PIN 7
CRGB leds[NUM_LEDS];
uint8_t paletteIndex = 0;
DEFINE_GRADIENT_PALETTE (heatmap_gp) {
0, 0, 0, 0,
128, 255, 0, 0,
200, 255, 255, 0,
255, 255, 255, 255,
};
CRGBPalette16 myPal = heatmap_gp;
void setup() {
// put your setup code here, to run once:
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
// FastLED.setBrightness(50);
}
template <typename PALETTE>
void fill_palette16(CRGB* L, uint16_t N, uint16_t startIndex, uint16_t incIndex,
const PALETTE& pal, uint8_t brightness=255, TBlendType blendType=LINEARBLEND)
{
uint16_t colorIndex = startIndex;
for( uint16_t i = 0; i < N; ++i) {
L[i] = ColorFromPalette( pal, colorIndex >> 8, brightness, blendType);
colorIndex += incIndex;
}
}
void loop() {
// put your main code here, to run repeatedly:
fill_palette16(leds, NUM_LEDS, paletteIndex << 8, 65535 / NUM_LEDS, myPal, 255, LINEARBLEND);
FastLED.show();
}
FPS: 0
Power: 0.00W
Power: 0.00W