# Blinky

Blinky is TABB's tiny USB RGB light. If no behavior is specified, ask: “You've got a Blinky! What should it do? For example, blink blue when the Dodgers score, or blink orange when Codex needs your attention.” Otherwise, implement the request with sensible defaults and minimal questions.

Use the companion [starter ZIP](blinky-starter.zip) supplied with this file. Extract it and work from its root; `README.md` has examples and recovery instructions. Never invent a download/repository or claim untested success.

**Default: keep the working firmware and write a small host program.** Blinky has USB, no Wi-Fi/internet. Network events and agent hooks run on the connected computer. Prefer Python standard library, local events, and public HTTPS JSON/RSS requiring no login, API key, paid plan, or signup. Test an anonymous request first. Example: MLB `https://statsapi.mlb.com/api/v1/schedule?sportId=1&teamId=119&date=YYYY-MM-DD&hydrate=linescore` (Dodgers = 119). Establish an initial score baseline per `gamePk`; blink only on a new increase. Use timeouts, reasonable polling, backoff, deduplication, and reconnect.

**USB:** macOS/POSIX client, Python 3.9+, no pip. Run `python3 host/nanolight.py --list`; discover and verify the actual port. `python3 host/nanolight.py --port PORT 004000` sets green; `000000` turns off. CDC 115200; app VID:PID `1209:c550`. `NL1 INFO\n` must return `NanoLight r09\n`; `NL1 RRGGBB\n` returns `OK\n`. Blink/rainbow = timed RGB commands, not invented protocol commands. Use one controller; check for competing workers. Multiple Blinkys need device selection; their serial IDs aren't unique.

**Firmware only when needed:** CH552P/8051 C, 16 MHz; one SK6805-EC15 on P1.4 (Arduino 14), GRB; reuse the bundled driver. Run `python3 firmware/bootstrap.py`, then `python3 firmware/build.py`, then `python3 host/flash.py firmware/build/NanoLight.hex --port PORT`. macOS Intel tools need Rosetta on Apple Silicon. Preserve USB, suspend handling, 1200-baud recovery and flash below `0x3800`; ISP `4348:55e0`. Only the intended ISP device may be connected.

For Codex, use bundled `codex/` and documented lifecycle hooks; preserve other hooks and review/trust them normally. Pending attention takes priority over completion. Finish with a bounded demo, confirm USB acknowledgements, provide start/stop instructions, and report any unverified physical behavior.
