#include <FastLED.h>
#define NUM_LEDS 9
#define DATA_PIN 4
CRGB leds[NUM_LEDS];
void setup() {
delay(2000);
FastLED.addLeds<WS2811, DATA_PIN, GRB>(leds, NUM_LEDS);
}
void flash2812(){
for(int flashLed = 0;flashLed < NUM_LEDS; flashLed = flashLed + 1) {
leds[flashLed] = CRGB::Green;
FastLED.show();
delay(100);
leds[flashLed] = CRGB::Black;
}
}
void loop() {
flash2812();
}
相似问题