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

◆ shiftUp()

void shiftUp ( )

Definition at line 158 of file simple.h.

158 {
159 // fade each led by 1%
160 if (fadeToBlack.as_int()) {
161
162 for (int i = 0; i < NUM_LEDS; ++i) {
163 auto &c = framebuffer[i];
164 c.fadeToBlackBy(fadeToBlack.as_int());
165 }
166 }
167
168 for (int y = HEIGHT - 1; y > 0; --y) {
169 fl::CRGB* row1 = &framebuffer[frameBufferXY(0, y)];
170 fl::CRGB* row2 = &framebuffer[frameBufferXY(0, y - 1)];
171 fl::memcopy(row1, row2, WIDTH * sizeof(fl::CRGB));
172 }
173 fl::CRGB* row = &framebuffer[frameBufferXY(0, 0)];
174 fl::memset(row, 0, sizeof(fl::CRGB) * WIDTH);
175}
#define NUM_LEDS
fl::CRGB framebuffer[NUM_LEDS]
Definition simple.h:77
int y
Definition simple.h:93
fl::UISlider fadeToBlack("Fade to black by", 5, 0, 20, 1)
fl::XYMap frameBufferXY(WIDTH, HEIGHT, IS_SERPINTINE)
#define WIDTH
#define HEIGHT
void * memcopy(void *dest, const void *src, size_t n) FL_NOEXCEPT
Definition cstring.h:103
void * memset(void *s, int c, size_t n) FL_NOEXCEPT
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Definition crgb.h:38

References fadeToBlack(), framebuffer, frameBufferXY(), HEIGHT, fl::memcopy(), fl::memset(), NUM_LEDS, WIDTH, and y.

Referenced by loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: