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

◆ loop()

void loop ( )

Definition at line 109 of file SmartMatrixSketch.h.

109 {
110 static uint8_t circlex = 0; // okay static in header
111 static uint8_t circley = 0; // okay static in header
112
113 static uint8_t ihue=0; // okay static in header
114 fillnoise8();
115 for(int i = 0; i < kMatrixWidth; i++) {
116 for(int j = 0; j < kMatrixHeight; j++) {
117 // We use the value at the (i,j) coordinate in the noise
118 // array for our brightness, and the flipped value from (j,i)
119 // for our pixel's hue.
120 leds[XY(i,j)] = CHSV(noise[j][i],255,noise[i][j]);
121
122 // You can also explore other ways to constrain the hue used, like below
123 // leds[XY(i,j)] = CHSV(ihue + (noise[j][i]>>2),255,noise[i][j]);
124 }
125 }
126 ihue+=1;
127
128 // N.B. this requires SmartMatrix modified w/triple buffering support
129 pSmartMatrix->fillCircle(circlex % 32,circley % 32,6,CRGB(CHSV(ihue+128,255,255)));
130 circlex += random16(2);
131 circley += random16(2);
132 FastLED.show();
133 // delay(10);
134}
fl::CRGB leds[NUM_LEDS]
void * pSmartMatrix
Pointer to the matrix object when using the Smart Matrix Library.
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
uint8_t noise[NUM_LAYERS][WIDTH][HEIGHT]
Definition Fire2023.h:97
void fillnoise8()
#define kMatrixHeight
uint16_t XY(uint8_t x, uint8_t y)
#define kMatrixWidth
fl::hsv8 CHSV
Definition chsv.h:11
fl::CRGB CRGB
Definition crgb.h:25
LIB8STATIC fl::u16 random16() FL_NOEXCEPT
Generate a 16-bit random number.
Definition random8.h:63
unsigned char uint8_t
Definition s16x16x4.h:209

References FastLED, fillnoise8(), kMatrixHeight, kMatrixWidth, leds, noise, pSmartMatrix, random16(), and XY().

+ Here is the call graph for this function: