
Reel 5 meters RGB LED Strip WS2812B 5V with 60 LEDs with IP67 Black Flexible PCB.
Note: The 5 meter coil comes with two connectors, if more connectors are needed, they are available here in the store in pairs.
For programming the Arduino, we will use the FastLED library.
This is an excellent and well documented library which enables easy control of the WS2812B LEDs.
#include <FastLED.h>
#define LED_PIN 7
#define NUM_LEDS 20
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
leds[0] = CRGB(255, 0, 0);
FastLED.show();
delay(500);
leds[1] = CRGB(0, 255, 0);
FastLED.show();
delay(500);
leds[2] = CRGB(0, 0, 255);
FastLED.show();
delay(500);
leds[5] = CRGB(150, 0, 255);
FastLED.show();
delay(500);
leds[9] = CRGB(255, 200, 20);
FastLED.show();
delay(500);
leds[14] = CRGB(85, 60, 180);
FastLED.show();
delay(500);
leds[19] = CRGB(50, 255, 20);
FastLED.show();
delay(500);
Related products
Reel 5 meters RGB LED Strip WS2812B 5V with 60 LEDs with IP67 Black Flexible PCB.
Note: The 5 meter coil comes with two connectors, if more connectors are needed, they are available here in the store in pairs.