What would the best/easiest way to have a color1 and color2 stripe along the entire length of a strip SCROLL from one end to the other?
Was wondering about a palette possibly, but not sure if I could get the sharp color changes like I’d want.
What would the best/easiest way to have a color1 and color2 stripe along the entire length of a strip SCROLL from one end to the other?
Was wondering about a palette possibly, but not sure if I could get the sharp color changes like I’d want.
@Trey_Coursey You could certainly use a gradient color palette and loop through it to move the color(s) down the line. Just put two “transition” points right together (one index apart) wherever you change from one color to another so there isn’t a visible gradient between them. Example (note the 127,128 indexes):
DEFINE_GRADIENT_PALETTE( red_white_gp ) {
0, 255, 0, 0, //red
127, 255, 0, 0, //red
128, 0, 255, 0, //green
255, 0, 255, 0 }; //green
Another option could be animating the transition point(s):
https://plus.google.com/102054795236178256184/posts/UWbQBcmKDdU
And as a reminder when using gradients:
https://plus.google.com/105930747209286685935/posts/HHyE8kXEpVi
Also, here’s some possible Christmas fun I just uploaded for you to try out:
@Trey_Coursey - My cd77_police_lights_all function in my CD77_Police_lights sketch at:
which is on YouTube at:
can be used to do what you want to do. Use the sketch as is but modify one of the color arrays or one of the palettes and modify the time performance code to do what you want to do. You can also just use a modified version of that cd77_police_lights_all function in your own sketch.
Thanks @marmil I was suspecting that might be the best case, have not messed with Gradients myself, but have seen them used. I will see if there is information on this, but I’m guessing the gradient fills the entire length of the LED_COUNT once, or is there a way to have it repeat more than once along the initial LED_COUNT? Thanks.
@Ken_White That looks very interesting to play with! Thanks so much.
Sure, it could repeat down the strip depending how you setup a for loop when assigning values to the pixels. Start experimenting and you’ll come up with new ideas the more you get into it.