Back to Parent

Process

When first working with the neopixels I wrote up a script for a particle function that accepts string based commands and parse them into different LED functions such as "ALL" (sets all pixels to given color), NUM: 1,5 (sets pixels 1-5 to given color) or STORE:1 (store given color at index 1 in pattern). A second particle function parses a a user string of RGB values formated as RRR,GGG,BBB to use with the given LED function.

This seemed to work well and I wanted to use it as a basis for the orb exercise as it would be a good demonstration of more complex user-programmable functionality from robust flexible functions. I could store a couple colors in a pattern and then fade between them when the notification triggers the pattern.  (Code below

However when attempting to get this running I had a lot of excess functionality making it difficult to test, I tried to streamline a bit and made a function explicitly for the red-white fade. Eventually I gave up and started a new file stripping away the generalized functions.

With the code stripped back I was able to trigger the white->red-white fade pretty reliably. I wanted to expand the code so it could flexibly handle other colors and attempted to use the constrain function and a variety of methods to calculate the time interval and increment for each color value. I also tried both struct and array based methods for color definition. I liked the variable naming of the struct but it made


Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0