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

◆ loop()

void loop ( )

Definition at line 105 of file SmartMatrix.ino.

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

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

+ Here is the call graph for this function: