jandelgado / jled

Non-blocking LED controlling library for Arduino and friends.
MIT License
332 stars 55 forks source link

Request: Make Update(uint32_t now) public #129

Open paoSoft opened 1 month ago

paoSoft commented 1 month ago

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

jandelgado commented 1 month ago

Good idea, besides some optimizations in the JLedSequence class this can also simplify some tests