Firmware · Program structure and state machines
Replacing blocking delays with elapsed-time checks lets a loop stay responsive, though some latency always remains.