Exemplo n.º 1
0
void LEDS::rainbow()
{
    _ledStrip.setPixelColor(firstRainbowIndex, Wheel((firstRainbowIndex + secondRainbowIndex) % 96));   
    _ledStrip.show();   // write all the pixels out

    if(firstRainbowIndex < _ledStrip.numPixels()) 
    {
        ++firstRainbowIndex;    
    }
    else
    {
        firstRainbowIndex = 0;
        if(secondRainbowIndex < 96 * 3) 
        {
            ++secondRainbowIndex;    
        }
        else
        {
            secondRainbowIndex = 0;
        }
     }
     Serial.print("first  ");
    Serial.println(firstRainbowIndex);
    Serial.print("second  ");
     Serial.println(secondRainbowIndex);

}
Exemplo n.º 2
0
// The colorWipe method switched all LEDs to one given color
void LEDS::colorWipe(uint16_t c)
{
  for(int i = 0; i < _ledStrip.numPixels(); ++i)
  {
    _ledStrip.setPixelColor(i, c);
    _ledStrip.show();
  }
  delay(50);
}
Exemplo n.º 3
0
void LEDS::setOneColorForAll(uint16_t color1)
{ 
  int i = 0;
 
  while(i < _ledStrip.numPixels())
  {
      _ledStrip.setPixelColor(i, color1);  
      ++i;          
      _ledStrip.show(); 
  }
 
 }