E-switch UI Development / FSM

Almost anything can be modded… it’s just a matter of how much effort it requires.

For example, the Coke can light:

I can’t really recommend using 4000 lumens on one’s forehead though, at least not for more than short amounts of time. The output is mostly limited by heat and thermal properties, and increasing that generally requires adding a lot of mass. So, for anything small enough to be used as a forehead light, the performance at ~1000 lm or less is generally going to be a lot more important than how bright its turbo/burst mode is.

If a headlamp isn’t reaching far enough, it’s generally more practical to change it to a throwier beam pattern than to double or triple the lumens. Switching from XM-L2 to XP-G2 will generally reduce the lumens but increase the throw, which makes it appear brighter.

ToyKeeper

I guess I’m not making my point clear (my fault :nerd_face: ). I’m talking about 2 different lights. First, a thrower (like my Olight M3XS-UT) with ramping. Or an EDC similar to the D4, only more tactical.

I’m not suggesting it either. But as an EDC, a 4000 lumen right angle light with an e-switch on the top of the light would be much easier to manipulate under stress in a tactical situation.

The D1 and D1S are compact throwers with ramping. The D1S isn’t out yet, but it should be soon. It is estimated at about 120 kcd though, not 250 kcd like the M3XS-UT. So, it should get about 700m throw instead of 1000m. Or the D1 gets about 425 m.

ToyKeeper

Wow, D1S 700 meters? It was going to be my next purchase anyway. That’s more than I expected, (right up there with my old M31 Triton).

My D1 arrived yesterday and I played around a little with it this morning. I wasn’t expecting that much (over 400 m?) either, I was thinking maybe 200 m. I’ll have to give it a better workout tonight.

Thanks!

I finally put a development branch up with the current FSM code:

http://bazaar.launchpad.net/~toykeeper/flashlight-firmware/fsm/files/head:/ToyKeeper/spaghetti-monster/

I still have some things to do before making a “1.0” release and merging it into trunk, but it’s already at a pretty usable state.

Things which still need to be done:

  • Finish more example UIs.
  • Add a half-sleep mode for things like a locator flash or alarm clock mode.
  • Add a waking idle mode for lower power use at moon/low levels.
  • Add support for voltage-divider style measurements on pin 7.
  • Add indicator LED support.
  • Add an option to use short-click/long-click/hold instead of just click/hold, because it’s needed for compatibility with UIs from fonarevka.
  • Test thermal regulation on a wider range of hardware, to ensure it “just works” on hosts of many different sizes and power levels.
  • Better documentation.
  • Hopefully make the fourth PWM channel less funky. It works, but not quite as well as the first three.

After “1.0”, it should probably also add support for newer MCUs, buck/boost drivers, more than one e-switch, and power-disconnect switches.

Oh, um, I also settled on a name for the “unnamed” UI. It’s called Andúril, because it’s inspired by Narsil. Narsil was the sword of Elendil and Isildur, which defeated Sauron. Andúril is Aragorn’s sword, the flame of the west, the blade Narsil reforged. Granted, it didn’t defeat Sauron — it only scared some ghosts. But still. I thought it would be appropriate, and Tom seemed okay with the idea, so that’s what it’s called now.

I don’t understand most of the things spoken in this thread, I confess, but I do appreciate your work and efforts - TK - along with the one of other members! Thanks for making better UIs and for putting your imagination “at the service of the Light”!!! :+1:

Now, following your last post, I just wanna suggest that the first BLF light with the “Andúril” UI be named “Mithril”, being a “impenetrable” maybe “bullet proof” flashlight!! A flashlight for knights that can be kings of the Light! Just saying :crown:

This forum is getting better and better (and I’m just a noob here) due to people that are working and investing time, money, intelligence and other resources to make things (lights, components, UIs, drivers….) that somewhere in time seemed impossible and that now are just cool and feasible realities!

I’ll keep on reading, and trying to learn a bit from this work!
Keep it up :+1:

Mithril o_O
well, the FW3A colour is silver. That would fit.

The accent in Andúril is bad for searching. I think a simple u would be better.

Hum, don’t know if the FW3A creators/developers team would agree/appreciate that but…why not? :smiley:
Sharp inside with Anduril firmware, armored and blasted outside with a silver “shining” look as Mithril, aiming to protect us from darkness :blush:

If it wasn’t a long name, “Light of Earendil” would also be appropriate :sunglasses:

(well, just hope these names wouldn’t raise Copyright or whatever issues)

I checked first. Part of why I waited was to make sure people didn’t mind.

I’d like to flash Andúril to one of my Q8s.

I successfully reflashed my D4 with the v2 firmware, but I’m still a total n00b with the process.

I’m still confused about the fuse values. Are these dependent on the hardware, firmware, or both?

How do I know what to use for the Q8 and Andúril? Do I simply reuse the values that come with the Q8’s stock NarsilM 1.0 firmware?

Also, when I attempt to build a HEX file with Amtel Studio 7, I get two errors:

  • recipe for target ’main.o’ failed
  • spaghetti-monster.h: No such file or directory

I’ve downloaded spaghetti-monster.h, but I’m unsure of where to place it for ’#include “spaghetti-monster.h”’ to see it.

EDIT: I’m making progress! I now understand I need to place all of the .h and .c files in the project directory for the #include commands.

EDIT 2: I got a successful build! The ’Hey, you need to define ATTINY.’ error made me lol. :smiley:

Please forgive my ignorance, I’m in waaaaay over my head here!

Ohh, I was talking about the “Mithril” name for the FW3A, not about the firmware :wink:
Independently of the name of the flashlight, I’m sure I’ll love that firmware on it!!! All my lights have “conventional” clicky modes, so a ramping mode, also with clicks, and extras like those you’re inserting on it, will be awesome!!
Once again, thanks for the efforts on these masterpieces :+1:

goshdogit, it’s intended to be built with the bin/build-85.sh script and flashed with the bin/flash-85.sh script. These are written for unix-like systems though, so it’ll require adaptation to build in Windows.

It’s also a good idea to grab the entire repository to retain its directory structure, so all the files will be there. This is easy with bzr installed, or not so easy otherwise. Perhaps I should get in the habit of doing .zip releases of the entire repository, since that’s easier in Windows.

FWIW, this is what I’d normally do:

  1. bzr branch lp:~toykeeper/flashlight-firmware/fsm
  2. cd fsm/ToyKeeper/spaghetti-monster/anduril
  3. …/…/…/bin/build-85.sh anduril
  4. …/…/…/bin/flash-85.sh anduril.hex

The build uses fsm~~.c and fsm-.h in addition to the files in the subdir for the current UI… and some of the tk~~*.h files in the parent directory. Basically, it relies on having parent directories in the include path with the “-I… -I…/… -I…/…/…” options in the build script.

Thanks for the reply! I managed to download the header files individually and got a successful build.

I’ve got about 30 browser tabs open between two desktop machines and a tablet, but no Linux box. The last time I used unix was on a Sun Workstation in the tail-end of the ‘purple logo’ era. :smiley:

Can you offer any guidance for the fuse values? I read some stuff that made me worry about bricking the 85 by using the wrong values.

The fuse values are in the flash-85.sh script.

Me looking at Narsil and Andùril:
It is sick to operate that amount of stuff with one button.

:slight_smile: :stuck_out_tongue:

Can we have an easter egg?
Tapp 12 times and the lamp blinks out la cucaracha in morse code?

SUCCESS!

I’m currently being mesmerized by “Lightning Storm” mode on a BLF Q8!

ToyKeeper, thanks so much for all of your amazing innovations and willingness to help others!

I think you may be the first person to actually try this UI. Feedback is appreciated.

If you’re willing, I may also want to try to add support for the lighted button and ask you whether it works. I don’t have hardware for that yet.

I’m honored! I will fiddle with Andúril and report back with my thoughts. I’m loving it! I just put it on my D1, too.

I feel awful that you don’t have a Q8 to play with yet! As you mentioned when photos of the internals appeared, it’s easy to reflash because of the long emitter wires. Remove the two driver screws and you’re in.

I’ll be glad to test the illuminated switch when you add support. I didn’t put these pink 0603s in to remain dark! :wink:

I took a class in C (or was it C?) in high school, and I’m having fun browsing your code and attempting to understand what’s going on. It’s nicely commented. “Sleep dammit! (but wait a few seconds first)” :smiley:

BTW, to turn the indicator LED on or off, I’m thinking maybe triple-click in lockout mode? This would configure whether the button stays illuminated while the main light off. Unless there’s a better place to put this option.

I could instead put an actual config mode inside lockout, for all settings related to standby behavior, but so far it looks like there’s just one option.

I’m also thinking maybe it should do something different with the indicator LED depending on whether the light is off or locked. Like, one could blink while the other is steady.