Normally, using the public Update() method is fine, but with many leds/sequences to update, the consecutive calls to millis() comes with a cost, which can be mitigated with using a local variable and one call to millis(),
Pseudo code:
loop() {
unsigned long now = millis();
led1.Update(now);
:
ledN.Update(now)
sequence.Update(now);
:
lots of other code...
}
Normally, using the public Update() method is fine, but with many leds/sequences to update, the consecutive calls to millis() comes with a cost, which can be mitigated with using a local variable and one call to millis(), Pseudo code: loop() { unsigned long now = millis(); led1.Update(now); : ledN.Update(now) sequence.Update(now); : lots of other code... }
BR, Pål