Here’s a summary of FSM-based interfaces created so far.
Momentary
A simple on-off interface.
- Hold the button: Light is on.
- Release the button: Light is off.
Mostly added as an example.
Baton
Similar to the Olight Baton series.
From off:
- 1 click: Turn on at last-ramped level.
- Hold: Lowest level, then ramp up in steps.
- 2 clicks: Highest level.
- 4 clicks: Soft lockout.
While on:
- 1 click: Off.
- Hold: Ramp up in steps. Loops back from highest level to lowest.
- 2 clicks: Go to/from highest level.
Soft lockout:
- 4 clicks: Turn on at “low” level.
Includes LVP and thermal regulation.
DarkHorse
Nearly exact clone of Zebralight’s UI from 2016.
From off:
- 1 click: High mode.
- 2 clicks: Med mode.
- 3 clicks: Blinky mode.
- 4 clicks: Battcheck mode.
- Hold: Low mode, then ramp up.
Low/med/high modes:
- 1 click: Off.
- Hold: Ramp through low, med, and high… always starting at low.
- 2 clicks: Toggle between H1/H2, M1/M2, or L1/L2 levels.
- Click, hold: Change the brightness of current mode’s secondary (H2/M2/L2) level.
Battcheck mode:
- Blinks 1 to 4 times then turns itself off. (0 blinks for less than 3.0V, 5 blinks for more than 4.2V)
Blinky mode:
- 1 click: Off.
- 2 clicks: Go to next blinky mode. The sequence is:
- 0.2 Hz beacon at L1
- 0.2 Hz beacon at H1
- 4 Hz tactical strobe at H1
- 19 Hz tactical strobe at H1
Remembers a few things after battery change:
- Primary or secondary toggle for high/med/low.
- H2/M2/L2 levels.
- Which blinky was last used.
Includes LVP and thermal regulation.
Andúril
Fancy all-in-one UI inspired by Tom E’s fantastic Narsil. It’s still a work in progress, so it’s expected to change.
I should probably mention that the smooth and discrete ramps have independent floor/ceiling values. You can have one with the ceiling all the way up, and one with the ceiling at a comfortable safe level. Or you can have one with moon and one without.
Discrete ramp mode has anywhere from 2 to 150 steps, spaced evenly (or as close to “even” as possible with integers).
A “hold” always ramps up, and a “click-release-hold” always ramps down.
Sorry about the 5-click action for momentary mode. Too many states available from “off”.
Beacon and momentary mode use the last-ramped brightness level.
Momentary mode is permanent until power is disconnected.
“Good night” mode starts at low and slowly ramps down for an hour, then shuts itself off. Intended for tail-standing next to a bed at night.
I set the PWM levels to start at 1/255. Depending on the hardware, this may be too low to make any light. However, the ramp floor can be set to whatever level you think looks good.
Config modes are similar to bistro — they blink out a number, pause, then “buzz” for a while. Click during the “buzz” to set a new value. It’ll keep buzzing as long as you keep clicking. If you want to skip an option, just wait without clicking.
Settings which are remembered after a battery change:
- Smooth ramp floor / ceiling.
- Discrete ramp floor / ceiling / steps.
- Beacon timing.
- Temperature limit.
- Which strobe mode was last used.
- Bike flasher brightness.
- Party strobe speed.
- Tactical strobe speed.
Includes LVP and smooth thermal regulation.
Werner Dual-Switch
Since it’s a thing people might want, and since I think Lexel may have been requesting it, I took a moment to make a Werner-style momentary UI, side e-switch plus tail clicky-switch.
https://code.launchpad.net/~toykeeper/flashlight-firmware/fsm
The short version is:
While completely off (power disconnected):
- Click tail to turn on at memorized level.
- Hold e-switch and click tail to enter utility mode.
While on (regular “on” mode):
- Click tail switch to turn off.
- Click side switch to go brighter.
- Hold side switch to go dimmer.
In utility mode:
- Click side switch to go to regular “on” mode.
- Hold side switch to go turn on at lowest level.
- Double click side switch to turn on at highest level.
- 3 clicks: Battcheck.
- 4 clicks: Ramp config.
Battcheck mode: Blinks out battery voltage.
- Click to go back to utility mode.
- 2 clicks for tempcheck mode.
Tempcheck mode: Blinks out current temperature in C.
- Click to go back to utility mode.
- 2 clicks for battcheck mode.
- 4 clicks for thermal config mode.
Ramp config:
- During first “buzz”, click N times to set floor level to N out of 150 total levels.
- During second “buzz”, click N times to set ceiling level to 151 minus N.
- During third “buzz”, click N times to set number of total brightness steps.
- Each “buzz” can be skipped to leave the value as-is.
Thermal config:
- During first “buzz”, click N times to calibrate current temperature to N degrees C.
- During second “buzz”, click N times to set thermal ceiling to 30 C + N.
- Each “buzz” can be skipped to leave the value as-is.
Includes LVP and smooth thermal regulation, copied directly from Anduril.