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

◆ loop()

void loop ( )

Definition at line 53 of file BlinkParallel.ino.

53 {
54 static int loopCount = 0;
55
56 EVERY_N_MILLISECONDS(1000) { // Every 1 second (faster for QEMU testing)
57 loopCount++;
58 FL_WARN("Starting loop iteration " << loopCount);
59
60 // Add completion marker after a few loops for QEMU testing
61 if (loopCount >= 2) { // Complete after 2 iterations instead of 3
62 FL_WARN("FL_WARN test finished - completed " << loopCount << " iterations");
63 }
64 }
65
66 // Turn the LED on, then pause
67 blink(CRGB(8,0,0), 1); // blink once for red
68 blink(CRGB(0,8,0), 2); // blink twice for green
69 blink(CRGB(0,0,8), 3); // blink thrice for blue
70
71 delay(50);
72
73 // now benchmark
74 uint32_t start = millis();
75 fill(CRGB(8,8,8));
76 FastLED.show();
77 uint32_t diff = millis() - start;
78
79 Serial.print("Time to fill and show for non blocking (ms): ");
80 Serial.println(diff);
81
82 EVERY_N_MILLISECONDS(500) { // Every 0.5 seconds (faster for QEMU testing)
83 FL_WARN("FastLED.show() timing: " << diff << "ms");
84 }
85
86 delay(50);
87
88 start = millis();
89 fill(CRGB(8,8,8));
90 FastLED.show();
91 FastLED.show();
92
93 diff = millis() - start;
94 Serial.print("Time to fill and show for 2nd blocking (ms): ");
95 Serial.println(diff);
96}
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:74
#define EVERY_N_MILLISECONDS(N)
Alias for EVERY_N_MILLIS.
Definition lib8tion.h:1221
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86
#define FL_WARN(X)
Definition warn.h:18

References blink(), EVERY_N_MILLISECONDS, FastLED, fill(), and FL_WARN.

+ Here is the call graph for this function: