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

◆ loop()

void loop ( )

Definition at line 43 of file RGBW.ino.

43 {
44 uint32_t ms = millis();
45
46 for(int i = 0; i < NUM_LEDS; i++) {
47 // Use different noise functions for each LED and each color component
48 uint8_t hue = inoise16(ms * TIME_FACTOR_HUE, i * 1000, 0) >> 8;
49 uint8_t sat = inoise16(ms * TIME_FACTOR_SAT, i * 2000, 1000) >> 8;
50 uint8_t val = inoise16(ms * TIME_FACTOR_VAL, i * 3000, 2000) >> 8;
51
52 // Map the noise to full range for saturation and value
53 sat = map(sat, 0, 255, 30, 255);
54 val = map(val, 0, 255, 100, 255);
55
56 leds[i] = CHSV(hue, sat, val);
57 }
58
59 FastLED.show();
60
61 // Small delay to control the overall speed of the animation
62 //FastLED.delay(1);
63
64}
CRGB leds[1]
#define NUM_LEDS
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
#define TIME_FACTOR_SAT
Definition RGBW.ino:24
#define TIME_FACTOR_VAL
Definition RGBW.ino:25
#define TIME_FACTOR_HUE
Definition RGBW.ino:23
uint8_t hue
Definition advanced.h:94
fl::u16 inoise16(fl::u32 x, fl::u32 y, fl::u32 z, fl::u32 t) FL_NO_EXCEPT
fl::hsv8 CHSV
Definition chsv.h:11
fl::u32 uint32_t
Definition s16x16x4.h:219
MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > > map
Definition map.h:283
fl::u32 millis() FL_NO_EXCEPT
Universal millisecond timer - returns milliseconds since system startup.
unsigned char uint8_t
Definition s16x16x4.h:209

References FastLED, hue, inoise16(), leds, NUM_LEDS, TIME_FACTOR_HUE, TIME_FACTOR_SAT, and TIME_FACTOR_VAL.

+ Here is the call graph for this function: