Sequences and Crossfading

Hello - I’ve just purchased this board to experiment with. I’d like it to replace my own self-programmed Christmas lights controller.

Does it support sequences of patterns (rainbow followed by flashing etc.)?

Does the sequence support cross fading (changing from one pattern to another over a set period of time)?

Can the controller manually select the next pattern?

Thanks

1 Like

Hi Mark -

A christmas lighting project is what got me back into my Pixelblaze recently.

There’s three ways to sequence patterns: The built-in sequencer, triggering different patterns externally via the wifi network connection (using the websocket API that Firestorm uses), and writing code to combine multiple patterns into a single pattern. This last one is the only one that could accomplish crossfading at the moment.

You can see the built in sequencer at the top of the main Patterns tab. To specify the order patterns run in, give them names that sort them lexically (e.g. start your first pattern with “10 -“ then “20 -“ and you can then change your mind later and insert “15 -“).

To trigger externally, there have been a few threads here on the forums that give detail on the websocket frame format. Search for Firestorm and you’ll find those pretty easily.

To write a sequencer in code, start by looking through the “Example: Modes and waveforms” pattern which comes preloaded on Pixelblaze (it’s also on the online pattern library).

To implement crossfading, there’s a few approaches off the top of my head, but unless you’re just fading through white or black, you’ll be implementing a method of variably blending each pixel. Maybe a weighted average of the R, G, and B values, or I’m sure there’s an HSV blending function out there somewhere you can adapt. Hope this helps get you started!

1 Like

Thanks for this. I’ve ordered 3, and will have a play around.

1 Like

I just put up some sample code for doing crossfading at the pattern library.

3 Likes

This is great! Is there a way to trigger specific pattern with a button then go back to the original pattern it was previously on?

Hi Kylet!

Yes, I think that’s quite doable. If you had the two-patterns-in-one crossfading code, you’d just trigger the change based on a button or capacitive touch input - see pinMode(INPUT_PULLDOWN), touchRead() and digitalRead() in the docs. If you have any Arduino experience this should feel very familiar. The only “fun” part is figuring out how to reference the pin you’re using, I always get confused, try a few things, then figure it out using the schematic :slight_smile:

2 Likes