Code: Select all
/* Step forward through each LED */
for(index = 0; index < NUMBEROFLEDS; index++)
{
HCWS2812.ClearBuffer();
RGBBuffer[RED][index] = 85;
if(index)
RGBBuffer[RED][index-1] = 15;
HCWS2812.Refresh();
delay(100);
}
/* Step backward through each LED */
for(index = NUMBEROFLEDS; index; index--)
{
HCWS2812.ClearBuffer();
RGBBuffer[RED][index - 1] = 85;
if(index < NUMBEROFLEDS)
RGBBuffer[RED][index] = 15;
HCWS2812.Refresh();
delay(100);
}