FastLED 3.10.10
Loading...
Searching...
No Matches

◆ loop()

void loop ( )

Definition at line 67 of file BlinkParallel.ino.

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

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

+ Here is the call graph for this function: