Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[arduino source code for KC868-Uair-1] WS2812 RGB LEDs blink
#1
#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: 
.zip   Uair-LED.zip (Size: 364 bytes / Downloads: 248)

Note: install "FastLED" library online firstly.
   
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)