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

◆ loop()

void loop ( )

Definition at line 65 of file BlinkParallel.ino.

65 {
66 static int loopCount = 0;
67
68 EVERY_N_MILLISECONDS(1000) { // Every 1 second (faster for QEMU testing)
69 loopCount++;
70 Serial.print("Starting loop iteration ");
71 Serial.println(loopCount);
72
73 // Add completion marker after a few loops for QEMU testing
74 if (loopCount >= 2) { // Complete after 2 iterations instead of 3
75 Serial.print("Test finished - completed ");
76 Serial.print(loopCount);
77 Serial.println(" iterations");
78 }
79 }
80
81 // Turn the LED on, then pause
82 blink(CRGB(8,0,0), 1); // blink once for red
83 blink(CRGB(0,8,0), 2); // blink twice for green
84 blink(CRGB(0,0,8), 3); // blink thrice for blue
85
86 delay(50);
87
88 // now benchmark
89 uint32_t start = millis();
90 fill(CRGB(8,8,8));
91 FastLED.show();
92 uint32_t diff = millis() - start;
93
94 Serial.print("Time to fill and show for non blocking (ms): ");
95 Serial.println(diff);
96
97 EVERY_N_MILLISECONDS(500) { // Every 0.5 seconds (faster for QEMU testing)
98 Serial.print("FastLED.show() timing: ");
99 Serial.print(diff);
100 Serial.println("ms");
101 }
102
103 delay(50);
104
105 start = millis();
106 fill(CRGB(8,8,8));
107 FastLED.show();
108 FastLED.show();
109
110 diff = millis() - start;
111 Serial.print("Time to fill and show for 2nd blocking (ms): ");
112 Serial.println(diff);
113}
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
fl::CRGB CRGB
Definition crgb.h:25
#define EVERY_N_MILLISECONDS(N)
Alias for EVERY_N_MILLIS.
Definition lib8tion.h:1045
fl::u32 uint32_t
Definition s16x16x4.h:219
fl::u32 millis()
Universal millisecond timer - returns milliseconds since system startup.
void delay(u32 ms, bool run_async=true) FL_NOEXCEPT
Public delay wrapper that keeps bare Arduino delay() preferred after using fl::delay; while still all...
Definition delay.h:98
#define Serial
Definition serial.h:304

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

+ Here is the call graph for this function: