Hello everyone,
I've finally gotten the following code (mostly) working with my sparkfun pro micro, a 5m (160 pixel) led strip and a 5-position switch (yes, for a hula-hoop). Now I am wanting to add more cases (ie patterns) to the handlestrip() function. However, for the life of me, I cannot figure out how a few things work:
-
Does "tick" just continue to count up to 4,294,967,295 (because it is an unsigned long) and then stop? What is the point of this?
-
In handlestrip(case 3) below, does every pixel in the strip turn on when "tick" is a multiple of 100, and then off when "tick"/50 has a remainder of 1 (e.g. at 51; 101; 151; 201...)? Is there a better way to adjust the rate of "strobing?"
-
How would I implement the ledbeltkit functions found later in the code (colorwipe, colorchase, dither, larson scanner, etc.) into additional cases in handlestrip() while retaining the ability to cycle through colors?
-
Would it be possible to read the last color that was displayed on the strip/pixel and then display the opposite color? Or, would it be possible to do a strobe in predefined colors while still retaining the ability to cycle through colors? For example, when using one of the strobe functions, instead of turning one color on and off, I want it to strobe between two colors - one that comes from GetColor() and another that is predefined depending on what GetColor() returns. (So, anytime GetColor() returns red, the second strobe color will be yellow. Anytime GetColor() returns blue, the second strobe will be white.. etc.)
Thank you all in advance ![]()
code: