Hey all, hoping for some guidance on the use of the Color Palette example.

fastled-support
gplus
(Jeff Howard) #1

Hey all, hoping for some guidance on the use of the Color Palette example. What I’d like to do is instead of having the animation just change from one palette in the sequence to the next, have a transition where the first palette would animate out down the strip and the next palette animates in behind it. Attached a visual of the desired effect as it compares to what’s currently in the library example. Hope that helps clarify.

Anyone come across an iteration of the Color Palette example that does this? or have a suggestion on what other example may be helpful for me to look at in understanding how to port that type of transition into the Color Palette code? Thanks in advance!

(Marc Miller) #2

When it’s time to transition you could use a temp array to store the current pixel data (and incoming pixel data) and then use a separate function to do the scroll/slide effect, and then go back to the normal palette stuff as before.

This example has some ideas that might be useful for what you want to do.

Other ideas are blending from one to the next when it’s transition time. Here are some examples by @Mark_Kriegsman that might help.

(Marc Miller) #3

@Jeff_Howard btw, what sort of image did you attach? When I view it, it’s mostly all black (thus I can’t read the text).

(Jeff Howard) #4

Thanks Marc, tried out each of those examples for the visual context first. Trying to deconstruct some of that code where I see some potential for applying the scroll/slide effect. Still working through that. In the meantime though, about the image. Was a transparent PNG. Had forgot google opens images to full view with a black background. Edit post won’t let me swap the image, so adding a jpg version of it here…

missing/deleted image from Google+

(Leon Yuhanov) #5

@Jeff_Howard Hey Jeff try out my colourObject https://github.com/leonyuhanov/colourObject its designed to create arbitrary dynamic palettes that you can move through

(Jeff Howard) #6

Thanks @Leon_Yuhanov I’m still working my way through the code @marmil shared. Will look into this further next. Would you have any videos of the code in action you can share? It’d be helpful to first see if that’ll be pushing me in the right direction

(Jeff Howard) #7

I haven’t quite figured out these sliding type transitions yet but using a wipe to white to bookend a custom gradient palette I’m using. That’s at least masked the jump between palettes for now. That’s left me with another question though. I’m shaping my LED strip into a circle. I’d like the animation to jump from the end of the strip back to the beginning seamlessly. Right now, the animation reaches the end of the strip, then there’s a delay of about a second before it starts over at the beginning. Any help with that would really be appreciated too. Thanks again!

(Andrew Tuline) #8

My suggestion would be to:

  • maintain two palettes
  • use a millis() counter with the ‘%’ or mod operation to track the current location of the change to the other palette.
  • use the fill_palette() function to fill from 0 to change and then from the change to NUM_LEDS-1.
  • The trickiest part will be to determine the startindex value (see below) for the first palette as it traverses up the strand. That will take some noodling.

fill_palette(leds, NUM_LEDS, startindex, incindex, gBeatPalette, 255, LINEARBLEND);

Edit: I spent some time on this, and it’s trickier than one might think. Have got it running, but I later realized I had to deal with the startindex as well.