News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Les's Flame Effect WS2812B

Started by charliecoutas, Sep 02, 2025, 08:09 AM

Previous topic - Next topic

charliecoutas

Les, I have incorporated your Flame Effect WS2812B driver into my Flame Effect Fire. It really adds a sense of realism. I have also got crackling fire sounds and the whole thing now just needs finishing off, wood-work etc.

So many thanks for the Flame Effect code. I'll do some photos....

Charlie

top204

#1
I look forward to a video of it Charlie.

Are you using the first or second demo I created? The second demo is much gentler.

You could be even more creative and play converted WAV files with certain fire sounds, when the colour of the LEDs change. 8-bit WAVs converted to flash memory on a 128K device will sound OK, with a decent filter, amplifier, and speaker. Or use a seperate MP3 player board with several fire noises that get triggered depending on the LED colours.

charliecoutas

I'm using your vsn4 Les. I have a DF_Player with a BBC soundtrack of a fire popping and crackling but it's not in sync with the LEDs. It's looking really good and I will synchronise the flashes with the pops and crackles when the time is right.

Right now I'm cutting up a huge sheet of 18mm MDF to make the upper and lower "boxes" that make up the fire. This involves using power tools and my history with these devices is not 100% but fingers crossed....

Charlie

top204

#3
Your experiment with an electronic fire effect, triggered my creativity again, and my fascination with the WS2812B RGB LEDs. So I wrote some code that animates a flame on a 16x16 WS2812B matrix board:

WS2812B Matrix Board - Flame Animation Page on my Rosetta site

charliecoutas

That's fantastic Les. Although I have "flames", that 16x16 board will add yet more realism. Where did you get the WS2812B 16x16?

Charlie

Colin G3YHV

Your WS2812b library looks Great Les. I have ordered a few 16x16 matrix leds to play with !

top204

#6
Many thanks Colin, Charlie.

It always makes the task of coding more enjoyable, when people have appreciation for the learning and coding that has to be done to get something working as it should. I also like to make my code listings as understandable as I can make them, and as efficient as I can make them, which takes more time, but is well worth the extra time.

I've looked in several places for the 16x16 WS2812B panels Charlie, and they are now plentiful and inexpensive, but the cheapest I can find it is:

WS2812B 16x16 Matrix at AliExpress

Which, if it is correct, is ridiculously inexpensive at £4.96! I couldn't even post it for such a small sum of money for such a board! It has come to the point where we, in the UK, simply cannot compete with the asian market, that can sell a whole board (and post it half way around the planet) for the price we pay for a single component, or to have the PCB alone made.

Regards
Les

Fanie

#7
As always Les, your software is excellent.

I want to comment on the prices of items and components in the West, not just in the UK.
Yesterday I was looking at prices locally of pic micro's, 16F pics sell over ZAR 100 here, I can buy three ESP32's for the same price.  Same with power supplies, I can buy a whole regulated PCB for less than the local regulator chip.

I know the forum members are against supporting the Asian market, but how do one make ends meet if everything here is priced out of the resulting dwindling market ?

We can still win if we too can make use of the less expensive Asian market.  Almost everything is from there in any case, like the last 16F pics was sent to me directly from Taiwan, not the US.  The world is changing, maybe if one adapt a little bit it can become a bit easier.  Please reconsider supporting the ESP's as well.


charliecoutas

Les: I've just spent 20 minutes wrestling with the Rosetta site. I can't download the WS2812B_Fire_Animate file because I must be a bit thick. I finally logged in and was allowed to copy the library file name, but that's all.

Help!

Charlie

top204

#9
I've just pointed on the link in the above post, and gone to the Google page. Then clicked on the link on the bottom of the Fire Animate page, to download the "WS2812B_Fire_Animate.zip" file, and it downloads OK. Without having to log into anything.

The Download icon is on the "top right" of the Google page, and will show teh text "Download" when the mouse is hovered over it. It had me confused when I first started using google as well, and all it wanted to do when the zip file in the middle of the page is clicked on, was to open it.

Below is a screenshot of it downloading:

Fire_Animate_Download.jpg

charliecoutas

#10
Almost there, I now just have an unfound procedure: Matrix_UpdateGamma()  (not found). Can't see it anywhere?

Charlie

Just found it, thanks Les!

top204

Make sure you unzipped the file to its own folder named: "WS2812B_Fire_Animate". Because I added the Gamma correction procedures especially for the matrix with the flame animation, because without the gamma, it was a bit too dim. And the .bas file will use the "WS2812B_Matrix.inc" file within its own folder, before looking elsewhere for it.

Regards
Les