1
Candlelight Flashlight with a nanjg
3
Wed, 10/29/2014 - 11:18
6
The season of candlelights and lanterns is coming, I felt the need of a
7
flashlight which has a artificial candle flickering.
9
A short google search shows a lot of guys already did this so less work for me
11
This guy used a photodiode to sample a flickering candle and gave some basic
12
instructions on how to simulate that:
14
http://inkofpark.wordpress.com/2013/12/15/candle-flame-flicker/
16
This guy implemented a very simple version for a tiny13
18
https://github.com/mokus0/avr-shake/blob/master/examples/flicker/flicker.c
22
http://inkofpark.wordpress.com/2013/12/23/arduino-flickering-candle/
24
I stole the project from github and tried it, worked like I wanted it to be so
25
I changed it to use the standard nanjg outputpin and flashed it on a nanjg
28
Here is the code I used:
29
https://www.dropbox.com/s/vkdaowql47vdp2s/candleflicker.rar?dl=0
31
I just flashed it on a standard nanjg with standard fuses FD and 75. It runs on
32
9Mz which is probably to fast for the small voltage but it seems to work well I
33
will try it out when I find more time. I also have the compiled hex in the
34
project folder so you simply can flash it like every other firmware. This has
35
no modes or battery protection or anything else it is just a in my eyes good
36
working flickering code. For indoor use it is a bit nervous to look at the
37
"flame" but in a lantern/box it works like a candle in the wind