Ejemplo n.º 1
0
// Initializing the LED-strip
void LEDS::ledStripInit()
{
    _ledStrip.setCPUmax(40);
    _ledStrip.begin();
    _ledStrip.show();
   
}
Ejemplo n.º 2
0
void setup() {
  // The Arduino needs to clock out the data to the pixels
  // this happens in interrupt timer 1, we can change how often
  // to call the interrupt. setting CPUmax to 100 will take nearly all all the
  // time to do the pixel updates and a nicer/faster display, 
  // especially with strands of over 100 dots.
  // (Note that the max is 'pessimistic', its probably 10% or 20% less in reality)
  
  strip.setCPUmax(50);  // start with 50% CPU usage. up this if the strand flickers or is slow

  // initialise our LED strip
  strip.begin();
  // make the first pixel red as an indicator that it is awaiting data
  strip.setPixelColor(0, 10, 0, 0);
  // turn all the other pixels on so we know they're working
  for(uint16_t i = 1; i < stripLength; ++i)
    strip.setPixelColor(i, 5, 5, 5);

  strip.show();
  Serial.begin(serialRate);
}