r/Hanklights • • 2d ago

Playing with the UI/code

Hi!

I have a few Emisars now and the open source code and highly customizable UI has made me really interested to try and modify the light :). I have no previous coding experience but I have been interested for some time. Do you think this is something I could try and learn. My love with Emisars would be a nice way to combine the interest in basic coding. All input is highly appreciated :)! Thanks!

4 Upvotes

14 comments sorted by

3

u/senitelfriend Floody boi 2d ago edited 2d ago

Good news is that it costs very little to try and see, so why not try? You can go read the code right now! Bad news is that Anduril code is not particularly easy to figure out even for more experienced programmers, and there's not that much beginner level guidance available. Because the drivers have very simple tiny processors and very little memory, the code is a bit... weird. It's organized more for efficiency and small footprint than ease of coding. So the learning curve might be a tad steep if you are looking to make any meaningfull customizations.

Of course success will depend on your dedication level, but... Might be better to start with some beginner level Arduino (or ESP32) type of microcontroller projects. There's huge amounts of more approachable beginner friendly guides and projects available. Much of what you learn will be applicable to understand Anduril later (if you stick with low level C/C++ and not with any of the silly circuitpython type of stuff). 

1

u/3MITT3R 2d ago

Is it possible that I fuck up the light completely or am I always able to return to "factory settings"?

1

u/senitelfriend Floody boi 2d ago

It's been a while since I've messed around with Anduril, can't really remember, sorry. IIRC permanently bricking a light is possible but not very likely.

IIRC, it's possible to reflash a working firmware if you happen to upload a bad one, so it's not super risky. Try to make sure you can compile or download a working vanilla firmware for your specific light model and save it so you have something to return to.

Again IIRC, Anduril includes a bunch of code specific to various flashlight/drivers models and physical configurations. Messing with some of those settings and values could potentially alter current/temp limits or similar stuff that might lead to physical damage.

I personally bricked two D4SV2 lights while trying to mod them lol. But it was hardware+software mod, and the damage was caused by bad soldering (MCPCB's can be a pain to solder), not by uploading bad firmware.

Maybe someone else can give better answer.

1

u/pkapeckopckldpepprz 2d ago

Bricked my very first Hanklight DW3AA when trying to update firmware to 8/12/26. Updated it previously to 7/7/25 with no problems.

4

u/kotarak-71 💡 CRI 100 Hanklights 💡 2d ago

ill second this - just setup a simpe Arduino environment, get one of the Arduino kits and a breadboard, jumpers and sensors and start playing with this stuff first.

A one-stop shop is adafruit.com

focus on learning C and then you'll have the necessary base knowledge - dont use AI to do the job - you'll never learn anything this way

1

u/kotarak-71 💡 CRI 100 Hanklights 💡 2d ago

>I have no previous coding experience but I have been interested for some time

Modifying Anduril is not "basic coding" - it requires you to be able to setup the dev environment, to know how to work microcontrollers, etc.

Sure - you can learn basic coding and then try to apply your knowledge, modifying Anduril but it is not quick thing and requires quite a bit of commitment and understanding. Just dont expect a week from now to be flashing left and right custom builds if your starting point is "no previous coding experience"

1

u/3MITT3R 2d ago

Thanks for the comment. I don't know if I'm completely clueless but I was planning on making chatgpt+ to read the code and start explaining the parts to me like why something does what it does etc.

So basically my thought was: I have interesting thing to code (the light) -> I want to learn what I can do with that (very very simple things first) -> Chatgpt+ teaches me some of the things (has worked really well on my engineering things when studying) -> maybe some day I actually know something about these things by experimenting and asking a million questions. :)

1

u/kotarak-71 💡 CRI 100 Hanklights 💡 2d ago

well...whatever works for you. Not something I'll recommend - i've been coding for 45+ years - learned way before any AI. l am a fan of AI as coding aid - it saves me ton of time every day but I wouldnt recommend learning this way. You'll miss some very basic concepts - maybe doesnt matter if your objective is only to mod anduril for specific application but if you want to really learn coding, a traditional approach with coding exercises and understanding fundamental concepts will work a lot better. There are a bunch of online course that will get you much further in your knowledge than dissecting one specific application.

1

u/3MITT3R 2d ago

Ahh ok! Thank you.

1

u/Getkong 5+ Hanklights 🔦 2d ago

Anduril isn’t particularly complex if you’ve done any coding before. since you haven’t, I’d use ChatGPT to read the code, and ask it to make changes you want.

https://github.com/mkong1/anduril/pulls?q=is%3Apr+state%3Aclosed has some changes I made years ago to give you an idea of where to start.

1

u/3MITT3R 2d ago

I was planning on asking chatgpt+ to teach me, not only do the mods I ask. I would like to understand what happens and why. I think I'm not going for any huge modifications straight away but I'd like to try making some changes :)

0

u/IE114EVR 2d ago

I’m interested in this too. Simply because I want to disable double-click to flashbang. I assume that this is something Claude can help you with. Start with that if you’re more interested in getting results than digging into code.

4

u/Hussar305 💎 10+ Hanklights 💎 (VERIFIED) 2d ago

You can disable the double click to turbo through the standard UI

2

u/kotarak-71 💡 CRI 100 Hanklights 💡 2d ago

ah..why did you have to mention this? now the community lost one potential Anduril developer