Archived source flow
Technical notes
Startup and storage
Holding the button at startup selects fixed defaults and writes the three settings; otherwise those byte values are restored from EEPROM.
Button-duration routing
The loop calls displayLEDs() before checking the button. After a blocking wait for release, durations from 300 to under 1000 ms advance colour, 1000 to under 2500 ms advance effect, and 2500 ms or longer enter ledCountMenu(). The changed setting is written to EEPROM.
Count menu
Inside the blocking menu, a press shorter than 500 ms increments the count modulo NUM_LEDS + 1. A longer press restores the temporary colour/effect selections and exits; the caller then persists the count.
Material source limits
EEPROM-restored indices are not validated before palette use. The count menu allows zero, while line-brightness calculations divide by the count. Button timestamps use int, so timing on the intended target also needs validation.