6#define NUM_LEDS (WIDTH * HEIGHT)
9#define LED_TYPE WS2812B
10#define COLOR_ORDER GRB
27fl::u16
XY(fl::u16
x, fl::u16
y) {
55static const int MAXP = 256;
61 int I = (int)(tt / 50);
67 float noiseW = (n1 / 255.0f) *
WIDTH;
69 p.
a = tt * 1.25f + noiseW;
70 p.
f = (tt & 1) ? +1 : -1;
86 float r = constrain(s * 0.5f, 1.0f, 3.0f);
87 int R = (int)ceilf(r);
88 int cx = (int)roundf(fx);
89 int cy = (int)roundf(fy);
91 for (
int dy = -R; dy <= R; ++dy) {
92 for (
int dx = -R; dx <= R; ++dx) {
93 float d2 = dx * dx + dy * dy;
96 float fall = 1.0f - (d2 / (r2 + 0.0001f));
97 uint8_t v = (uint8_t)constrain(255.0f * fall, 0.0f, 255.0f);
118 for (
int i = 0; i <
MAXP; ++i)
139 for (
int i = 0; i <
MAXP; ++i) {
153 float tOver99 = (float)
t / 99.0f;
154 uint8_t n2 =
inoise8((uint16_t)(tOver99 * 4096), (uint16_t)(p.
g * 37));
155 float n2c = ((int)n2 - 128) / 255.0f;
159 float aa = p.
a * (float)p.
f;
XYMap xymap(WIDTH, HEIGHT, SERPENTINE)
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
central include file for FastLED, defines the CFastLED class/object
CLEDController * controller
#define kMatrixSerpentineLayout
unsigned int xy(unsigned int x, unsigned int y)
Base definition for an LED controller.
void setDiameter(float diameter)
static XYMap constructWithUserFunction(u16 width, u16 height, XYFunction xyFunction, u16 offset=0)
static XYMap constructSerpentine(u16 width, u16 height, u16 offset=0)
static XYMap constructRectangularGrid(u16 width, u16 height, u16 offset=0)
void fadeToBlackBy(CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy)
void blur2d(CRGB *leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const fl::XYMap &xymap)
Two-dimensional blur filter.
void plotSoftDot(float fx, float fy, float s)
u16 xy_map_function(u16 x, u16 y, u16 width, u16 height)
void plotDot(int x, int y, uint8_t v)
void resetParticle(P &p, uint32_t tt)
uint8_t inoise8(uint16_t x, uint16_t y, uint16_t z)
8-Bit, fixed point implementation of Perlin's noise.
LIB8STATIC_ALWAYS_INLINE uint8_t scale8(uint8_t i, fract8 scale)
Scale one byte by a second one, which is treated as the numerator of a fraction whose denominator is ...
fl::u16 XY(fl::u8 x, fl::u8 y)
Representation of an RGB pixel (Red, Green, Blue)
Representation of an HSV pixel (hue, saturation, value (aka brightness)).