#define NUM_LEDS 256
void setup() {
Serial.begin(115200);
delay(1000);
}
for (int i = 0; i < NUM_LEDS; i++) {
leds[i] = color;
}
}
void blink(
CRGB color,
int times) {
for (int i = 0; i < times; i++) {
fill(color);
delay(500);
delay(500);
}
}
void loop() {
delay(50);
uint32_t start = millis();
uint32_t diff = millis() - start;
Serial.print("Time to fill and show for non blocking (ms): ");
Serial.println(diff);
delay(50);
start = millis();
diff = millis() - start;
Serial.print("Time to fill and show for 2nd blocking (ms): ");
Serial.println(diff);
}
CFastLED FastLED
Global LED strip management instance.
central include file for FastLED, defines the CFastLED class/object
void show(uint8_t scale)
Update all our controllers with the current led colors, using the passed in brightness.
static CLEDController & addLeds(CLEDController *pLed, struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
Representation of an RGB pixel (Red, Green, Blue)