I've been working on and off (no pun intended ) on my enhanced version of e-switch, and after the bad ground fiasco, I ran into another frustrating issue, but I think finally this evening I fixed it, very happy now... Btw, the downloading is working like 100% reliable now - best it's ever worked, more reliable then I ever had with a 13A -- never seem to get a bad clip on. Amaz'n what a good ground will do...
TK - haven't had time to look at yours, sorry.
The problem I had was very intermittent, no apparent pattern that I could repeat it with, but it would flake out after switching from hi to OFF - sometimes it worked fine 10x in a row, then intermittently occur, sometimes resulting in a lock-up with the light ON or OFF - bazaar stuff. The changes that fixed it were:
- eliminate possible redundant back to back output to the TCCR0A register to set PWM mode (FAST or PHASE)
- clearing of the pressDuration variable in a couple more places, which seemed not necessary
I'm thinking the first fix in more explainable, though I'm not sure why. Then again, I've been testing for only a few minutes, doing all sorts of crazy things and can't reproduce it so far, doesn't mean it's truly fixed yet.
Enhanced features:
- 8 mode sets to choose from, plus hi->lo option, plus mode memory
- lock-out feature to disable possible inadvertent clicks (quick sequence of click-click-click&hold for 2 secs)
- compile time option:
- for e-switch's with a tail power switch, mode settings available off the power switch
- or double blink for power-on (when using a tail lock-out, the blinks will occur to signal battery is connected)
Still need to add some things, but it's beyond a 25 now - needs a 45 or 85 to run.
FYI - my test light has been a SupFire M2-Z I bought from Richard for modding. Wow - what a deal. It's a perfect light for the lock-out feature: it has no tail switch and bare threads so impossible to lockout with unscrewing the tailcap. A 22 mm driver fits fine, has a nice threaded retainer ring, and a wired side switch mounted to the housing (stock driver is not needed. I used long LED wires so I could pop it out and re-program without much of a fuss, and could do basic testing with a battery wired direct to the driver and the driver wired in to the head, giving you full control with the side switch. I swapped the plastic reflector for an alum one (XP-R C8 style), and put in a XP-L V6 3D on a Noctigon - didn't worry bout bypassing springs yet.
I was gonna use a Crelant 7G2CS, but it turned out the driver shelf is way too wide and would interfere with components on the driver - I'd have to machine some material from the shelf (inside the pill) to fix it up. Might be easier to piggyback a driver, not sure yet.
These are the modes:
Mode Set Order |
Mode Count |
Mode Percentages |
Notes |
1 |
5 |
ml-2-10-40-full |
10=max 7135, 40=mixed |
2 |
4 |
ml-10-35-full |
10=max 7135, 35=mixed |
3 |
3 |
5-35-full |
5=1/2 7135, 35=mixed |
4 |
7 |
TK BLF A6 7 mode |
moon plus 6 evenly spread |
5 |
4 |
TK BLF A6 4 mode |
no moon, 4 evenly spread |
6 |
3 |
ml-10-full |
moon, max 7135, max FET |
7 |
2 |
10-full |
max 7135, max FET |
8 |
1 |
full only |
(full is always max FET, no 7135) |