FastLED 3.10.8
Loading...
Searching...
No Matches

◆ loop()

void loop ( )

Definition at line 62 of file RGBWW.ino.

62 {
63 // Animate a slow warm <-> cool transition. The colorimetric solver
64 // chooses the warm/cool blend per pixel based on the input chromaticity,
65 // so writing CRGB stays the same as a normal sketch — only the wire
66 // format and color science change.
67 uint32_t ms = millis();
68 uint8_t blend = sin8(ms / 16); // 0..255 triangle-ish
69
70 // Lerp between a warm white tint (255, 200, 130) and a cool one (180, 200, 255).
71 CRGB warm(255, 200, 130);
72 CRGB cool(180, 200, 255);
73 CRGB mixed;
74 mixed.r = lerp8by8(warm.r, cool.r, blend);
75 mixed.g = lerp8by8(warm.g, cool.g, blend);
76 mixed.b = lerp8by8(warm.b, cool.b, blend);
77
78 fill_solid(leds, NUM_LEDS, mixed);
79 FastLED.show();
80 delay(20);
81}
CRGB leds[1]
#define NUM_LEDS
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
void fill_solid(CRGB *targetArray, int numToFill, const CRGB &color) FL_NO_EXCEPT
Fill a range of LEDs with a solid color.
Definition fill.cpp.hpp:10
CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2) FL_NO_EXCEPT
fl::CRGB CRGB
Definition crgb.h:25
LIB8STATIC fl::u8 lerp8by8(fl::u8 a, fl::u8 b, fract8 frac) FL_NO_EXCEPT
Linear interpolation between two unsigned 8-bit values, with 8-bit fraction.
Definition lib8tion.h:364
void delay(u32 ms, bool run_async=true) FL_NO_EXCEPT
Public delay wrapper that keeps bare Arduino delay() preferred after using fl::delay; while still all...
Definition delay.h:98
fl::u32 millis() FL_NO_EXCEPT
Universal millisecond timer - returns milliseconds since system startup.
unsigned char uint8_t
Definition stdint.h:208
fl::u32 uint32_t
Definition stdint.h:218

References blend(), FastLED, fill_solid(), leds, lerp8by8(), and NUM_LEDS.

+ Here is the call graph for this function: