Turbo knows what to step down from, but not what to step down to. You can change this by changing “mode_idx = solid_modes - 2;” to “mode_idx = mode_idx - 1;”. It looks like this should work in your case, even though it wouldn’t have worked if you had a turbo in the hidden loop. You could also just comment out the “#define NON_WDT_TURBO” to get rid of turbo step-down entirely.
2. I’ve been trying to fix that too, but I haven’t figured out a way to do it. I tried to use memory decay in combination with OTC measurements, hoping that mem decay wouldn’t have temperature issues… but that doesn’t work either. The OTC discharge keeps the memory from decaying when it’s supposed to. In any case, the temperature scaling is annoying.
3. Change all your red-only modes to use PHASE instead of FAST, and it should prevent the white LED from coming on. You can’t completely turn anything off in FAST mode.
Thanks, I’ll try that. Based on the code I posted earlier do you think that’s what the problem was? Turbo stepdown was working in the first mode group, but not the second group. Btw, I’ve been wondering what does the “NON_WDT” part refer to?
I guessed switching to PHASE would fix that 3rd issue, at least i’m starting to learn something!
You had turbo as the second-to-last mode in one of the groups, and it was configured to step down to the second-to-last mode. So it stepped down from turbo to turbo.
The reason it didn’t do “mode_idx —;” before is that one of the default turbo modes is hidden / negative, and I didn’t want it to “step down” from turbo to strobe. Your version doesn’t have to worry about that though.
The “NON_WDT” bit should probably be renamed. The code was originally based on STAR which used the watchdog timer to measure time for turbo, but it took too much room so I got rid of that and replaced it with a non-watchdog version. At one point there was an option to switch between the two methods, WDT turbo and non-WDT turbo, but I removed one.
BTW, why do you have both red and white turned on at the same time in one of the mode groups?
I was just playing around with stuff to see what it would look like. The light has two dedomed XP-L’s and a deep red XP-E on the same 20mm triple noctigon. It actually helps bring out the red spectrum quite a bit. My “CRI test” involves shining the light at my wife’s clothes in the closet. You don’t really notice much of a tint change, but the added red really makes the patterns “pop”, even more so than my Nichia light. It does some cool/interesting things to shadows too.
I just flashed my revised firmware, and something is wrong with the turbo timer. I’m testing it on my power supply, and it is stepping down after 4-5seconds. I tried values of both 60 and 90 ticks. What’s my problem? code paste
Tweaked the firmware so the second group is low red, high red, low white, high white, beacon and set all the red modes to phase PWM and now only the red lights up! Thanks!
I Just tried running it straight from a battery and it works perfectly. I’m still a little confused, as my measurements show the power supply holding steady. Either way, the flashlight is working and I’m happy to finally say this project is “done.”
I’ve also run into issues sometimes when testing things on a bench PSU instead of using a battery. It’s not usually so bad with lights, but some other hardware can behave pretty strangely with a dedicated power supply.
The PSU I’m using is limited to 5 amps, so high-powered lights hit a hard wall when they try to pull more than that. It’s fine at lower levels though. The really weird stuff only happens when I plug in devices with built-in chargers and other more complex circuits.
The closest thing is the repository index file, which is mostly intended for searching, not so much for reading. Beyond that, once you’ve found something compatible with your switch type and driver type, it’s mostly a matter of reading the text files included with the matching projects to figure out which ones sound best.