Skip to content

One burst and fade a minute on the Flash pattern - #148

Open
ii-impy wants to merge 1 commit into
mainfrom
claude/flash-one-burst-per-minute-Kp7mQ
Open

ii-impy wants to merge 1 commit into
mainfrom
claude/flash-one-burst-per-minute-Kp7mQ

Conversation

@ii-impy

@ii-impy ii-impy commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

What

The Jess bright LED ran a strobe train — four 250 ms blinks, then a four-second pause. This replaces it with a single burst once a minute:

  • 100 ms flat at the channel ceiling (max_level, 0.8 on Jess)
  • 1 s exponential fade out
  • ~59 s dark

The rise stays instantaneous so the LED still reads as punctuation rather than a lamp pulsing. Only the tail is faded. The fade curve (exp(-5u)) is normalised to land on exactly zero at the end, otherwise the channel would idle at a faint non-zero level for the rest of the minute.

Notes for review

Flash is no longer binary. max_level capping and the Blow-Up Reaction override both still behave, but the two existing tests asserted "off, or exactly the ceiling" and had to be rewritten:

  • test_flash_keeps_firing_while_stale — still drive-free, so a dead Pi keeps the heartbeat; now checks the peak reaches the ceiling and the total lit time is ~1100 ms.
  • test_flash_channel_bursts_once_a_minute — two edges per 60 s cycle, ~100 ms at the ceiling.
  • test_flash_fade_decays_monotonically_to_dark (new) — pins the decay shape: monotonic, dark by the end, and well under half brightness at the fade midpoint.

If 60 s ends up reading as "broken" rather than "heartbeat" on site, the knob to turn is kFlashDecay (lower = fatter tail) before the cycle length.

No open issue matches this change, so it closes none.

Verification

  • pio test -e native — 34/34 pass
  • pio run -e jess — builds clean

🤖 Generated with Claude Code

The Jess bright LED strobed four 250 ms blinks then paused four seconds.
That reads as an alarm rather than punctuation, and at this ceiling it is
a lot of light to throw at the windows every few seconds.

Replace the burst train with a single hit: 100 ms flat at the channel
ceiling, a one-second exponential fade, then a dark minute.  The rise
stays instantaneous so it still punctuates; only the tail is faded.  The
fade curve is normalised to land on exactly zero, so the channel is
genuinely dark for the rest of the cycle rather than idling faint.

Flash is therefore no longer binary.  The max_level cap and the Blow-Up
override are unaffected, but the two tests that asserted "off or the
ceiling" needed rewriting, plus a new one pinning the decay shape.

Verified: pio test -e native (34/34), pio run -e jess builds clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant