How To Build a Flashlight With Perfect Modes (picture heavy)

No, but you can just re-order the array so that the strobes are in front.

But in this case main mode would start from strobes too, and since I have only 2 modes in it, it wouldn't be very useful to have both of them strobes :) or there is a way to set different order of modes for main and extended?

The main group consists of indices into the extended group, you can't have modes in main that are not in extended. Let's take a look at the configuration array:


const uint8_t EEMEM eeprom[64] =
{   0x00, 0xFF, 0xFF, 0x00,
    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00,
    // initial mode programming, indices to mode lines in the following array
    0x03, 0x06, 0x08, 0x00, 0x00,
    // mode configuration starts here. Format is:
    // offset in mode_func_arr, func data1, func data2, func data3
    MODE_LVL001,    // 0x00
    MODE_LVL002,    // 0x01
    MODE_LVL004,    // 0x02
    MODE_LVL008,    // 0x03
    MODE_LVL016,    // 0x04
    MODE_LVL032,    // 0x05
    MODE_LVL064,    // 0x06
    MODE_LVL128,    // 0x07
    MODE_LVL255,    // 0x08
    MODE_STROBE,    // 0x09
    MODE_POLICE,    // 0x0A
    MODE_BEACON     // 0x0B
};

The main group is configured by the line:


    // initial mode programming, indices to mode lines in the following array
    0x03, 0x06, 0x08, 0x00, 0x00,

These are offsets into the extended group. The first mode is at offset 0x03 (MODE_LVL008), the second is at offset 0x06 (MODE_LVL64) and the third is at offset 0x08 (MODE_LVL255). The fourth and fifth slot are not used because NUM_MODES is set to 3. If you re-arrange the modes in the extended group, you will have to adjust these indices.

Oh, that's my bad, I just forgot about this line. So, I start the extended mode from strobes and arrange main to start from constant - that's what I needed so much from bicycle light. 2 constant modes with option to adjust brightness of "low" and hidden police strobe. Great respect Tido for your work, chinese engineers never would make something as exciting :) Only sad thing that ATTiny13A has as low as 1kb of memory, that is not enough for battery mon and programming, but that's I can stand with

edit: Redundant. :P

I am thinking to write the BLF-VLD-0.4 to another driver with an Attiny13A. The program seems to suit changing modes by the power on/off switch. Can I use an additional momentary contact switch to change modes without modifying the code ?

Thanks in advance,

AFAIK, no, this program doesn't support external switch to change modes

Hi Folks,

I tried to build a version 4 BLF-VLD with 3 modes + battery monitor from the Driver.c file by AVR Studio. The Studio failed to build the files because the contents of the object file exceeded the maximum program monery of the device. So I deleted the lines from 88 to 140 to save space.

The Hex file and the eep file can be built and run. However, the LED will be slow flashing after the light is switched on for a while. When the light is switched on at high or at Med, it will rampdown to low. Also, no response to the change of the voltage of the voltage divider. I would like to ask somebody to help me fixing the issue. Thank you.

I see that people are having trouble connecting to the chip. Which clip is the most effective one?

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=140572159337&ssPageName=STRK:MEWAX:IT

http://cgi.ebay.com/ebaymotors/ws/eBayISAPI.dll?ViewItem&item=400171159037&viewitem=&sspagename=STRK%3AMEWAX%3AIT

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=120703298973&ssPageName=STRK:MEWAX:IT

I had that one in the middle. That's crap. I've heard the 3M should be better, but cannot confirm by my own account. My advice? Go direct drive.

I vote for HID45-style too. It's not so hard and if you are flashing well-known 8x7135 driver, it has only 2 pins of MC need to be soldered directly on it, other pins have connections on PCB. So even wife is not necessary :)

Guys I really want to use a clip I don't want to risk damaging the drivers by extra soldering. I found these but they only show two attachments top and bottom will they still work the price is good.

http://www.hmcelectronics.com/product/3M-Interconnect-Solutions/923650-08?refer=peoplebought

http://parts.digikey.com/1/parts/389607-8-pin-test-clip-gold-soic-15-923655-08.html

http://parts.digikey.com/1/parts/389604-8-pin-test-clip-alloy-soic-15-923650-08.html

The 3M clip is the one I have, and it's way better than the Ebay blue one. I purchased it from Digikey as well. It has 8 pins if you look at the picture. However, I did need to use the ribbon cable off of the blue one as the 3M came with only the clip. I also had to modify the clip a bit (shave off the bottom) to get better contact, and now it's finicky. Try to get it to work as-is first.

Good deal I will order the one from Digikey, thanks man. I am super excited about doing this. I took C programming in college so it's time to dust off the books and once the clip arrives I will be ready to rock.

Yeah, it was a lot of fun doing this. I haven't built any flashlights in a while, and since I upgraded to Windows 7 I can't get the Atmel software working. I might get back into it again if a friend asks for a different light.

What programmer are you going with?

I ordered this one I hope it works.

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=200460739146&ssPageName=STRK:MEWNX:IT

The nice thing about this one, http://www.adafruit.com/products/46, is that she has a detailed out guide on how to use avrdude to program with (which yours might be able to work with too, not sure), and it ships from the US.

I wish I had seen that before I ordered the other one. Digikey is on point I placed my order about an hour ago and it already shipped unbelievable.

OK it looks like its working but I have a problem maybe someone can help.


Man I got everything working except i cant figure out how to load the program. I would like to load Tidos program just to go from there if someone could steer me in the right direction that would be great.