As promised. Here’s how you can make even more custom LED effects for other Holidays.
This is the non-programmer’s way to decipher and change the arduino sketch. There are certainly other (and likely better) ways to do it, but this is what I learned and how I did it. If you find other ways to make custom effects please share!
There are 4 ways to add custom colors to these effects.
- Use the Home Assistant color selector that is part of the Light function.
- Add a color palette to the BPM effect (shifting pulsing effect).
- Adafruit article about color palettes:
- Go to http://fastled.io/tools/paletteknife/ and make a bookmark out of the “PaletteKnife” link.
- Find a palette you like from one of these pages:
- Click the palette you want, then click the PaletteKnife bookmark, copy the result
- Paste it at the beginning of the Arduino sketch on your wemos board
- Copy the BPM effect, change the name to whatever you want
- Copy the name of your new palette and paste it over the name of the default BPM palette.
- Define new Hue colors for the Police All effect.
- Copy the Police All effect and rename it to whatever you want
- Copy line “uint8_t thishuepolice = 0;” paste it right below and replace “police” with whatever you want
- Go to the Hue value chart and pick a new Hue number based on the color you want. It doesn’t have to be the exact number of the pure color, it can be any number from 0 to 359. Replace the “0” with your new hue number.
- Choose another Hue color number (you get 2 colors for this effect).
- Go to your copy of the Police All effect. Find the line “int thathue = (thishuepolice + 160) % 255;”
- You want the number in the () to equal the number of your second hue, so do some math and change “+ 160” to whatever it needs to be to get your second hue number.
- Add new colors to the Candy Cane effect.
- Copy the Candy Cane effect and rename it to whatever you want.
- Find “CRGBPalette16 currentPalettestriped” Copy it and paste it right below.
- Change “current” to something you choose.
- Find “setupStripedPalette( CRGB::Red, CRGB::Red, CRGB::White, CRGB::White);” Copy and paste it right below. Change “Striped” to whatever you want.
- Find a list of HTML color names. Replace “Red” and “White” with the names of your colors.
- Find “void setupStripedPalette” section and copy everything from “void” through “}”. Paste it all right below, then change “Striped” to the same word you used when defining the colors above.
- In your copied list of A’s and B’s, change the A’s and B’s to either A, AB, B, BA, depending on how you want you colors arranged. A represents the first color, AB, the second, B the third, and BA the fourth.