I have a ramping UI now with smoothly-user-adjustable strobe with both party and tactical modes, facilitated by cooperative multitasking so it doesn’t interfere with event handling. This should also make it easy to add biking mode, battcheck, SOS, and other slow blinkies.
So, the current test UI is:
From off:
- 1 click: Go to memorized level.
- 2 clicks: Go to highest level. (shortcut to turbo)
- 3 clicks: Strobe mode.
- Hold: Go to lowest level, wait, then ramp up. (shortcut to moon)
- Click, hold: Go to highest level then ramp down.
In normal/steady mode:
- 1 click: Off.
- 2 clicks: Go to/from highest level (temporary turbo).
- 3 clicks: Strobe mode.
- 4 clicks: Toggle between smooth and discrete ramping (150 levels vs 7 levels).
- Hold: Ramp up.
- Click, hold: Ramp down.
- Full thermal regulation is active in this mode.
In strobe mode:
- 1 click: Off.
- 2 clicks: Toggle party strobe (freezes motion) vs tactical strobe (bright, disorienting).
- 3 clicks: Go to normal/steady mode at memorized level.
- Hold: Increase strobe speed.
- Click, hold: Decrease strobe speed.
- Speed range is 3.8 Hz to 120 Hz for party strobe, 2.6 Hz to 82 Hz for tactical strobe.
When voltage is low:
- If in strobe mode, go to steady mode at a low level.
- In steady mode, step down by about half the ramp.
- If already at lowest steady mode, turn off.
After LVP or thermal step-down, ramping goes from the stepped-down level, not from the original level it was at before. So, if it steps down and you want it back up, just hold the button to force it back up. However, it will probably step down again in a few seconds.
Moon and turbo aren’t memorized unless you manually ramp to them.
So far, nothing is remembered across a battery change. I haven’t written the eeprom API yet.
It currently compiles to 3480 bytes, but if I turn off thermal regulation that goes down to 2888 bytes.