//??????,?????????
void rainbowCycle(unsigned int wait)
{
unsigned int i, j;
for(j=0;j<256*5;j++)
{ // 5 cycles of all colors on wheel ????????5???
for(i=0;i<numLEDs;i++)
{
SetPixelColor(i, Wheel(((i * 256 / numLEDs) + j) & 255));
}
PixelUpdate();
HAL_Delay (wait);
}
}
//Theatre-style crawling lights.???
void theaterChase(unsigned long c, unsigned int wait)
{
int j,q;
unsigned int i;
for (j=0; j<10; j++)
{ //do 10 cycles of chasing ?10???
for (q=0; q < 3; q++)
{
for (i=0; i<numLEDs; i=i+3)
{
SetPixelColor(i+q, c); //turn every third pixel on ?????????
}
PixelUpdate();
HAL_Delay(wait);
for (i=0; i<numLEDs; i=i+3)
{
SetPixelColor(i+q, 0); //turn every third pixel off ???????????
}
PixelUpdate();
}
}
}
//Theatre-style crawling lights with rainbow effect
//?????????????
void theaterChaseRainbow(unsigned int wait)
{
int j,q;
unsigned int i;
for (j=0; j < 256; j++)
{ // cycle all 256 colors in the wheel ????????256?
for (q=0; q < 3; q++)
{
for (i=0; i < numLEDs; i=i+3)
{
SetPixelColor(i+q, Wheel( (i+j) % 255)); //turn every third pixel off ?????????
}
PixelUpdate();
HAL_Delay(wait);
for (i=0; i < numLEDs; i=i+3)
{
SetPixelColor(i+q, 0); //turn every third pixel off ???????????
}
}
}
}
// Fill the dots one after the other with a color
//???????????
void colorWipe(unsigned long c, unsigned int wait)
{
unsigned int i=0;
for( i=0; i<numLEDs; i++)
{
SetPixelColor(i, c);
PixelUpdate();
HAL_Delay(wait);
}
}
void main()
{
while(1)
{
rainbow(45);
rainbowCycle(40);
theaterChase(Color(0,0,255),80); // Blue
theaterChase(Color(0,255,0),80); // Blue
theaterChase(Color(255,0,0),80); // Blue
theaterChaseRainbow(40);
colorWipe(255,255);
}
}
確實是缺了},這里面有警告,應該是有程序沒調用吧?