Step 1: Open Up the Candle Casing
Step 2: Remove the LED Module
Step 3: Move the Cathode Wire
Step 4: Program Your Chip
Some notes about the source code: I used a generic random number generator because the stdlib rand() function is almost twice as large. When you only have 1024 bytes of Flash memory, every byte counts! Also, the millisecond timer doesn't seem to line up with real wall-clock time. But since exact timing isn't really important in this application, I just eyeballed the timing. Purists might cringe, but I'm a pragmatist. :)
To program using the supplied hex file on a Linux system, use this command line:
avrdude -p attiny13 -P usb -c usbtiny -U flash:w:flicker.hex
WinAVR users will probably know the right incantation. I don't do Windows. :D
Update: flicker2.zip contains the second version of the code, featuring two flicker patterns (flicker-up and flicker-down), along with adding watchdog protection to reset the chip if the mainline code should freeze.
Step 5: Trim the Chip Legs
Step 6: Make Some Connections
The red lead from the LED module connects to pin 5. The red lead from the battery goes to pin 8.
For the ground connection, use a fine-pointed needle-nose pliers to bend the pin in a "U". With a sharp utility knife, score the insulation of the yellow (negative) wire and pull it apart to expose a small section of bare wire. Place that section of bare wire in the "U" you just bent and solder carefully.