FastLED 3.9.15
Loading...
Searching...
No Matches

◆ loop()

void loop ( )

Definition at line 105 of file FireMatrix.ino.

105 {
106 FastLED.setBrightness(brightness);
107 CRGBPalette16 myPal = getPalette();
108 uint32_t now = millis();
109 timeScale.setScale(speedY);
110 uint32_t y_speed = timeScale.update(now);
111 for (int i = 0; i < HEIGHT; i++) {
112 for (int j = 0; j < WIDTH; j++) {
113 uint8_t palette_index = getPaletteIndex(now, i, j, y_speed);
114 CRGB c = ColorFromPalette(myPal, palette_index, BRIGHTNESS);
115 int index = xyMap((HEIGHT - 1) - i, (WIDTH - 1) - j);
116 leds[index] = c;
117 }
118 }
119 FastLED.show();
120}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define WIDTH
Definition Blur2d.ino:9
#define HEIGHT
Definition Blur2d.ino:10
#define BRIGHTNESS
Definition Blur.ino:8
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:58
TimeScale timeScale(0, 1.0f)
UISlider speedY("SpeedY", 1.3, 1, 6,.1)
UISlider brightness("Brightness", 255, 0, 255, 1)
CRGBPalette16 getPalette()
uint8_t getPaletteIndex(uint32_t millis32, int i, int j, uint32_t y_speed)
XYMap xyMap(HEIGHT, WIDTH, SERPENTINE)
int y_speed
RGB color palette with 16 discrete values.
CRGB ColorFromPalette(const CRGBPalette16 &pal, uint8_t index, uint8_t brightness, TBlendType blendType)
Get a color from a palette.
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54

References BRIGHTNESS, brightness, ColorFromPalette(), FastLED, getPalette(), getPaletteIndex(), HEIGHT, leds, speedY, timeScale, WIDTH, xyMap, and y_speed.

+ Here is the call graph for this function: