Wrote this over the last couple nights. It’s something I’ve wanted in a light but never could do until now. I’ll probably be putting this firmware into all of my lights and adapting it out as needed. I found through testing handheld flashlights, the strobe and beacon is rarely used- I’m not a biker. But picking modes for my lights wasn’t fun either.
I wanted a ramp as the base with a hidden mode that handles strobe. I also wanted full time voltage monitoring and low moon when the tail switch is on.
So after some late night programming I came up with this… It’s a smooth ramp up and down. It starts off in very low moon using fast pwm and the pwm 0 bug on a BLFDD driver. Looks pretty cool with a dedomed emitter like a white painted square.
Voltage monitoring is enabled through the watchdog interrupt anytime the tail is on. It’ll ramp down the light at low volts, and back to moon. This allows you to see the tail is on at any time too and gives you the heads up, time to charge!
Hold (eswitch) from off, and it ramps up all the way to 100%. An indication flicker was put in when you hit the top. On switch release and hold, the ramp goes opposite. You can get any light level you want. From off, you can single click to high and it will start the ramp backwards too. You can stop the ramp anywhere and go back and forth. Fast click turns it off.
The hidden mode strobe and beacon are done from off, double click. Any single click from that point alternates between the strobe and beacon. So let’s for example say you get jumped from behind like your in detroit or something. Ok your a gonner in that situation… lol
Ah I needed to stick something like that in here… jus cause
Anyways Double click to enter the hidden modes and if you hold the switch, it will flash once and you’ll be back to moon (off).
-If anyone could host this so others can play with it. I think this useful code for the community.