// https://www.reddit.com/r/FastLED/comments/1etf7dk/fill_gradient_flickers_a_ton_on_3k_leds_teensy_41/
#include <FastLED.h>
#include "fill_gradient2.h"
#define NUM_LEDS_STRIP 248
#define NUM_PINS 8
#define NUM_LEDS_TABLE NUM_LEDS_STRIP*NUM_PINS // 2976
typedef struct fillgrad {
uint8_t one;
uint8_t two;
uint8_t three;
uint8_t four;
uint8_t five;
uint8_t six;
} fillgrad_t;
fillgrad_t fg;
CRGB leds[NUM_LEDS_TABLE];
void setup() {
FastLED.addLeds<WS2812B, 25, GRB>(leds, 0, 248);
FastLED.addLeds<WS2812B, 22, GRB>(leds, 248 * 7, 248);
Serial.begin(115200);
}
void loop() {
mode_fillgrad();
FastLED.show();
int test_led = 0;
test_led = NUM_LEDS_TABLE - 1;
Serial.print(leds[test_led].r);
Serial.print(",");
Serial.print(leds[test_led].g);
Serial.print(",");
Serial.println(leds[test_led].b);
delay(20);
}
void fillgrad_random() {
fg.one = random8(1, 25);
fg.two = random8(0, 10);
fg.three = random8(200, 255);
fg.four = random8(1, 25);
fg.five = random8(0, 10);
fg.six = random8(200, 255);
}
void fill_grad() {
uint8_t starthue = beatsin8(fg.one, fg.two, fg.three);
uint8_t endhue = beatsin8(fg.four, fg.five, fg.six);
if (starthue < endhue) {
fill_gradient(leds, NUM_LEDS_TABLE, CHSV(starthue, 255, 255), CHSV(endhue, 255, 255), FORWARD_HUES);
} else {
fill_gradient(leds, NUM_LEDS_TABLE, CHSV(starthue, 255, 255), CHSV(endhue, 255, 255), BACKWARD_HUES);
}
EVERY_N_SECONDS(5) {
fillgrad_random();
}
}
void mode_fillgrad() {
EVERY_N_MILLIS(10) {
fill_grad();
}
}
esp:0
esp:2
esp:4
esp:5
esp:12
esp:13
esp:14
esp:15
esp:16
esp:17
esp:18
esp:19
esp:21
esp:22
esp:23
esp:25
esp:26
esp:27
esp:32
esp:33
esp:34
esp:35
esp:3V3
esp:EN
esp:VP
esp:VN
esp:GND.1
esp:D2
esp:D3
esp:CMD
esp:5V
esp:GND.2
esp:TX
esp:RX
esp:GND.3
esp:D1
esp:D0
esp:CLK
neopixels2:DOUT
neopixels2:VDD
neopixels2:VSS
neopixels2:DIN
neopixels3:DOUT
neopixels3:VDD
neopixels3:VSS
neopixels3:DIN