Smart Home Automation Forum

Full Version: [arduino source code for KC868-Uair-1] WS2812 RGB LEDs blink
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
#include <FastLED.h>

#define NUM_LEDS 4
#define DATA_PIN 32
CRGB leds[NUM_LEDS];

void setup() {
    FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
}

void loop() {
    leds[0] = CRGB::Blue;
    leds[1] = CRGB::Blue;
    leds[2] = CRGB::Blue;
    leds[3] = CRGB::Blue;
    FastLED.show();
    delay(2000);
    leds[0] = CRGB::Black;
    leds[1] = CRGB::Black;
    leds[2] = CRGB::Black;
    leds[3] = CRGB::Black;
    FastLED.show();
    delay(2000);
}

download arduino IDE source code file: [attachment=445]

Note: install "FastLED" library online firstly.
[attachment=446]