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

◆ loop()

void loop ( )

Definition at line 107 of file SmartMatrixSketch.h.

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

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

+ Here is the call graph for this function: