FastLED 3.9.15
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WS2816.ino
Go to the documentation of this file.
1
7
8#include <FastLED.h>
9
10// How many leds in your strip?
11#define NUM_LEDS 1
12
13
14#define DATA_PIN 3
15
16
17// Define the array of leds
19
20void setup() {
21 // Uncomment/edit one of the following lines for your leds arrangement.
22 // ## Clockless types ##
23 FastLED.addLeds<WS2816, DATA_PIN>(leds, NUM_LEDS); // GRB ordering is assumed
24}
25
26void loop() {
27 // Turn the LED on, then pause
28 leds[0] = CRGB::Red;
29 FastLED.show();
30 delay(500);
31 // Now turn the LED off, then pause
32 leds[0] = CRGB::Black;
33 FastLED.show();
34 delay(500);
35}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define NUM_LEDS
Definition Apa102.ino:6
CFastLED FastLED
Global LED strip management instance.
central include file for FastLED, defines the CFastLED class/object
void setup()
Definition WS2816.ino:20
void loop()
Definition WS2816.ino:26
WS2816 controller class.
Definition FastLED.h:218
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
Definition crgb.h:616
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition crgb.h:504
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:55