MCPcopy Create free account
hub / github.com/FastLED/FastLED / loop

Function loop

examples/Asio/Server/ServerReal.h:152–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void loop() {
153 // Update server multiple times per loop for better responsiveness
154 // Process up to 10 update cycles per loop iteration
155 fl::size total_processed = 0;
156 for (int i = 0; i < 10; ++i) {
157 fl::size processed = server.update();
158 total_processed += processed;
159 if (processed == 0) break; // No more pending requests
160 }
161
162 if (total_processed > 0) {
163 Serial.print("Processed ");
164 Serial.print(static_cast<int>(total_processed));
165 Serial.println(" request(s)");
166 state = REQUEST_RECEIVED;
167 lastEventTime = fl::millis();
168 // After processing, flash purple for "responded"
169 state = RESPONDED;
170 }
171
172 autoReset();
173 updateLEDs();
174 FastLED.show();
175
176 delay(10); // 10ms delay between cycles - up to 1000 requests/second possible
177}

Callers

nothing calls this directly

Calls 8

autoResetFunction · 0.85
updateLEDsFunction · 0.70
millisFunction · 0.50
delayFunction · 0.50
updateMethod · 0.45
printMethod · 0.45
printlnMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected