Update Oct 3: PD68 TripleDown/TripleStack - Tri-Channel Driver

Bistro-tripledown is intended for attiny25, but after verifying the hardware works you’ll probably want to change some things in the code. It’s still configured more for testing at the moment, and less for actual use. You may also want to re-calculate the ramp, depending on how bright your host is.

Thanks tk .
I will probably need your help in modifying the code , or some tips , but i will ask when i have the drivers ready…

Any news about this?

I would like to use this driver in a dual switch light (modified Courui D01)! Control the modes with the e-switch and on off via rear switch with mode memory.

Not tested just quickly put together during lunch break.

http://pastebin.com/f11HDPZw

Feel free to give it a go

Mk2 Version here

Not sure which will work best.

“fixed it” also posted some code a couple pages ago that I still haven’t gotten around to testing.

Flashlights have been on the back burner for awhile now

Thanks pyro1son, I’ll give it a try.

I see that #define ALT_MODES is commented out, do I need to remove the comment?

For example, if I would like to have 5 modes I would write the following?

#define MODES 1,90,255,255,255
#define ALT_MODES 0,0,0,255,0

So I would get moon, low, single 7135 on full, single + secondary 7135s on full, FET ?


edit: mmh I think with this config I would get the Turbo mode in mode 3 already. So it would be good if I could write

#define MODES 1,90,255,255,TURBO
#define ALT_MODES 0,0,0,255,0

use ALT_MODES for the single 7135
MODES for the larger bank
put 254 in MODES for the FET turbo and 0 in the ALT_MODES

I’ve commented in ALT_MODES

Nice clean looking code! Thanks!

Ok, so I built a board and tested it with a working rear clicky firmware. All fine and working :slight_smile:

Then I uploaded the new dual switch firmware and soldered a small cable to the outer ring.

I connected it to a battery and it starts in direct drive (=the highest mode).

If I touch the otc pad (=pin 2) with the small cable it should change modes right?

Anyway, nothing happens. I tried a few other pins on the attiny, but only the fet pin (=pin 3) did lower the output and as soon as I removed the small cable it was at direct drive again.

I tried both firmware versions and also tried it with and without the otc cap, because this is not needed in a dual switch light right? But no difference, I can’t get it to switch modes.

Here is a pictures of the driver, sorry it is a little bit dirty looking now.

Which code did you use?

I tried both, just changed the modes to

#define MODES 0,0,0,255,254
#define ALT_MODES 1,90,255,255,0
#define MODE_PWM PHASE,FAST,PHASE,PHASE,PHASE

Just make a fix in Mk2 there was a slight issue with some of the brackets. Try now.

I will try and get some time to test this myself but wont be for a while

Thanks, I’ll try the updated Mk2 version.

Ok tried it and still the same problem, the driver does not switch modes.


I also tried changing the switch_pin and fet_pin, because the switch is connected to pin 2 and the fet to pin 3 right?

#define SWITCH_PIN PB2
#define FET_PIN PB3

But also no luck with that …

Hmmmmmm,

I’ve tried something more like the current clicky switch FW HERE

Can you make sure that TK’s Ferrero_Rocher works on your driver first.

Ok I tried your new version but still the same, it starts in direct drive and won’t change modes.

I then downloaded the ferrero rocher hex file and flashed this and it also behaves strange.

If I connect it to the battery the led flashed one time very short and then it is dark again.

If I connect ground to pin 2 it cycles through the modes staring high to low.

If I connect ground to pin 2 for a short time it is at direct dirve and stays there.

Strange maybe I did something wrong with the driver.

The only firmware that I get to work properly is the one in the op for a rear clicky light.

Hmmm sound like there is something else wrong

FWIW, Ferrero Rocher is supposed to blink once and shut off when power is connected. Short and long presses should go through the modes in opposite directions. However, it also tries to use two pins for battery indicator LEDs, and that could be messing with the behavior.

I suspect that what happens is a short or long press cycles normally until you let go, then it tries to indicate battery status by turning on one or two pins. This causes the light to turn on another power channel at 100%, and it drowns out any mode changes you do afterward.

If you disable the battery indicator code, it’ll probably behave a bit better. But this at least suggests that the e-switch pin is physically working.

Been looking into it a bit more.

Mk4

nope sorry, tried it still no mode switching :frowning: