Has anybody done any code to simulate a candle flame?  Any ideas on how

Has anybody done any code to simulate a candle flame? Any ideas on how to approach this?

I’m looking for something simpler than that. The fire routine is a little more violent and aggressive. I understand that it could be modified with a different palette, but I’m interested in a different way to do it than that. Assuming there is not forward motion across a string as much as there is a flow of colors/shades.

I attended a very cool lantern festival last night (http://stillmoon.org), and, yes, I’d like to implement some Japanese lanterns with a more muted fire display as well.

Google “Arduino candle flicker” and you get many hits.

http://timbartlett.net/ledcandle/

http://www.richardvannoy.info/lab-05.php

Yes, me. Video here: https://www.youtube.com/watch?v=QmkCvihs0wo at 0:57 What did I do? I utilized Simplex Noise for shifting and smearing.

Hi @Stefan_Petrick , are you willing to share the Noise Smear III code?
Thank you!!

I made something simple: just pick randomly some CHSV values around yellow and update your (single) LED a few times per second.

@Myche_Tician , curious what your pixel setup is? Linear, grid, circular, other? The physical arrangement would probably influence how I would think about it.

Also, I’d suggest start simple and break it up into parts. Create a simple random pulse effect. A simple random flicker effect. Random slight color shift effect. Code each of these separately to keep things simple and to see how it effects the look. Then work on combining things into a more complete simulation.

If the LEDs are diffused nicely you shouldn’t need much action to achieve a candle effect.

@Juergen_Bruegl : Sure, the first time I published (and explained) the code here (read the comments): https://plus.google.com/115124694226931502095/posts/Df4zKAY7qHr
Later @Jason_Coon added palette support: https://plus.google.com/+JasonCoon1/posts/CtXEXeVHWR5
And here a version from him were he combined Fire2012 with the noise smearing: https://plus.google.com/+JasonCoon1/posts/3jpceKKRkeC
I hope that helps to inspire you!

@Stefan_Petrick Thanks a million !! Still struggeling to convert the settings from SmartMatrix to my 20x14 (ox plow) matrix, but I hope I will figure it out.

I’ve revisited this project and am working on my own candle code. I looked at the most common stuff out there and found a lot of it is not random. It feels very mechanical. I just adopted my own version that has a lot more random-ness, along with some other features like dipping and popping of the light. I’ve uploaded a YT video waiting for it to process. I’m trying to write some generic routines that will work in a variety of situations. I’m also curious how it would look with several separate candle sequences on a single light strip, so I want to make the code multi-tasking. Will post more on this.