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

◆ loop()

void loop ( )

Definition at line 109 of file FireCylinder.ino.

109 {
110 FastLED.setBrightness(brightness);
111 CRGBPalette16 myPal = getPalette();
112 uint32_t now = millis();
113 timeScale.setScale(speedY);
114 uint32_t y_speed = timeScale.update(now);
115 for (int width = 0; width < WIDTH; width++) {
116 for (int height = 0; height < HEIGHT; height++) {
117 uint8_t palette_index =
118 getPaletteIndex(now, width, WIDTH, height, HEIGHT, y_speed);
119 CRGB c = ColorFromPalette(myPal, palette_index, BRIGHTNESS);
120 int index = xyMap((WIDTH - 1) - width, (HEIGHT - 1) - height);
121 leds[index] = c;
122 }
123 }
124 FastLED.show();
125}
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
CRGBPalette16 getPalette()
TimeScale timeScale(0, 1.0f)
UISlider speedY("SpeedY", 1.3, 1, 6,.1)
XYMap xyMap(HEIGHT, WIDTH, SERPENTINE)
uint8_t getPaletteIndex(uint32_t millis32, int width, int max_width, int height, int max_height, uint32_t y_speed)
UISlider brightness("Brightness", 255, 0, 255, 1)
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: