Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is most likely no translated for the post!





Led strip effects -...
 
Share:
Notifications
Clear all

Led strip effects - Additional Fire questions


(@raffxj)
New Member
Joined: 4 years ago
Posts: 4
Topic starter  

hi ,

regarding the fire effects,

1> how do I display it for 2 digital output pins (say D3 and D4)?

2> can the fire effect be done independent of each other?

3> how do I change ''color'' of fire

BR.

Ralph


ReplyQuote
 Hans
(@hans)
Noble Member Admin
Joined: 8 years ago
Posts: 1767
 

Hi Raffxj,

sorry for the late response ...

Concerning your questions:

1) Two inputs

I'm no sure what you're trying to do, so it's hard to say what will/might work or not to get the desired effect.

The values of your input could be used to determine spark and cooling when calling the function:

Fire(int Cooling, int Sparking, int SpeedDelay)

2) Independent fire effect

Do you mean when using two strands? (I'm beginning to guess that you'd like to use it for audio - ie. left and right)

3) Fire color

Color is controlled in the function SetPixelHeatColor. Specifically in this section:

// figure out which third of the spectrum we're in:
  if( t192 > 0x80) { // hottest
    setPixel(Pixel, 255, 255, heatramp);
  } else if( t192 > 0x40 ) { // middle
    setPixel(Pixel, 255, heatramp, 0);
  } else { // coolest
    setPixel(Pixel, heatramp, 0, 0);
  }

You'll have to play with the parameters of the setPixel() functions. The last 3 numbers define the color.


ReplyQuote
(@raffxj)
New Member
Joined: 4 years ago
Posts: 4
Topic starter  

Hi Hans,

Fire(int Cooling, int Sparking, int SpeedDelay)

yes I have played around with this  I could even utilize "Sparking" and -tie- it to analog input.  and yes you are right, its for an existing audio project I have been experimenting with. that's why the need for 2 separate strands . 2 outputs, LEFT and RIGHT.

so I was wondering :

#1 > how you could 'separate' the fire effect to run on 2 different strands.

 #1.1 >  could it also do (fire effect) on BOTH different strands, like mirror of each other (meaning 1 process only). fire effect is just "mirrored" from other strand.

regarding fire 'çolor', I will try editing some of those paramaters. I was hoping for a single variable (?) only to change color.. I might tie it to an external pot, and vary color 'ón the fly'

I hope I am clear with my explanation here. lol. sorry . not so much good at coding 


ReplyQuote
 Hans
(@hans)
Noble Member Admin
Joined: 8 years ago
Posts: 1767
 

As for controlling 2 strands; I have not tested this yet.

As I understand from others, is that each strand has to be re-initialized when doing something with them. Meaning; set strip left, do effect, set strip right, do effect, and repeat ...

Not sure (since I never tested this) if the delay is "bad" enough to not want to go this route.

As for mirroring, again not tested, but maybe it works by connecting the strips in parallel?
Ie. connect Din (the data-in pin) from strip-left, to the same pin (Din) of strip-right.
This might work, but might also not work ...


ReplyQuote
(@raffxj)
New Member
Joined: 4 years ago
Posts: 4
Topic starter  

Hi Hans,
Haven't tried yet using separate fire functions.. but have done the mirror only(sw), not hw(tie both the strip Din)..yes it works now (mirrored)
in my mind, it would (I think) cut the FPS in half.. don't know.. did not try 
only thing missing is setting 'çolor' here... have done a crude one, but lack the know-how of how to fine-tune it, maybe declare just a single value for a complete range of the color spectrum

void setPixel(int Pixel, byte red, byte green, byte blue) 
  {
     // crude setup of FIRE color
     strip.setPixelColor(Pixel, strip.Color(red, blue, blue)); // strip 1 RBR=violet BBR=blue
     strip1.setPixelColor(Pixel, strip.Color(red, blue, blue)); // strip 2
  }


ReplyQuote



(@raffxj)
New Member
Joined: 4 years ago
Posts: 4
Topic starter  

Hans,

add a  "color picker" function perhaps  same as one in your WS2812 tuturial page

only problem is, I suck at coding. lol


ReplyQuote
 Hans
(@hans)
Noble Member Admin
Joined: 8 years ago
Posts: 1767
 

Thanks raffxj for the suggestion and my apologies for the very later reply.
It's been a little crazy here the past few weeks (just moved to the US) ...

Hmm, adding a color picker is not a bad idea! 
I'll add it to my "To do" list - I definitely think that would be useful.


ReplyQuote

Like what you see and you'd like to help out? 

The best way to help is of course by assisting others with their questions here in the forum, but you can also help us out in other ways:

- Do your shopping at Amazon, it will not cost you anything extra but may generate a small commission for us,
- send a cup of coffee through PayPal ($5, $10, $20, or custom amount),
- become a Patreon,
- donate BitCoin (BTC), or BitCoinCash (BCH).

Share: