Skip to content

Instantly share code, notes, and snippets.

@dlmorgan999
Created June 15, 2014 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlmorgan999/8a48f24ee9b9ca29042f to your computer and use it in GitHub Desktop.
Save dlmorgan999/8a48f24ee9b9ca29042f to your computer and use it in GitHub Desktop.
void WaveTest::draw()
{
uint8_t brightness;
uint8_t brightness1;
uint8_t brightness2;
unsigned long endTime;
shuffleColors();
blankDisplay();
endTime = millis() + 15000;
while (millis() < endTime)
{
for (int i = 0; i < LEDS_PER_STRIP; i++)
{
brightness1 = sin8((millis() / 50) * i);
brightness2 = cos8((millis() / 20) * i);
for (int j = 0; j < NUMBER_OF_STRIPS; j++)
{
if (j % 2 == 0)
{
brightness = brightness1;
}
else
{
brightness = brightness2;
}
ledsALL[j][i] = CHSV(colorsH[j].hue, DEFAULT_SATURATION, brightness);
}
}
updateDisplay(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment