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

◆ loop()

void loop ( )

Definition at line 203 of file XYMatrix.ino.

204{
205 uint32_t ms = millis();
206 int32_t yHueDelta32 = ((int32_t)cos16( ms * (27/1) ) * (350 / kMatrixWidth));
207 int32_t xHueDelta32 = ((int32_t)cos16( ms * (39/1) ) * (310 / kMatrixHeight));
208 DrawOneFrame( ms / 65536, yHueDelta32 / 32768, xHueDelta32 / 32768);
209 if( ms < 5000 ) {
210 FastLED.setBrightness( scale8( BRIGHTNESS, (ms * 256) / 5000));
211 } else {
212 FastLED.setBrightness(BRIGHTNESS);
213 }
214 FastLED.show();
215}
#define BRIGHTNESS
Definition Blur.ino:8
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:58
#define kMatrixHeight
#define kMatrixWidth
void DrawOneFrame(uint8_t startHue8, int8_t yHueDelta8, int8_t xHueDelta8)
Definition XYMatrix.ino:181
LIB8STATIC_ALWAYS_INLINE uint8_t scale8(uint8_t i, fract8 scale)
Scale one byte by a second one, which is treated as the numerator of a fraction whose denominator is ...
Definition scale8.h:34
LIB8STATIC int16_t cos16(uint16_t theta)
Fast 16-bit approximation of cos(x).
Definition trig8.h:143

References BRIGHTNESS, cos16(), DrawOneFrame(), FastLED, kMatrixHeight, kMatrixWidth, and scale8().

+ Here is the call graph for this function: