Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.