FastLED 3.9.15
Loading...
Searching...
No Matches
Blink.ino
Go to the documentation of this file.
1
4
5#include <Arduino.h>
6#include <FastLED.h>
7
8// How many leds in your strip?
9#define NUM_LEDS 1
10
11// For led chips like WS2812, which have a data line, ground, and power, you just
12// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
13// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
14// Clock pin only needed for SPI based chipsets when not using hardware SPI
15#define DATA_PIN 3
16#define CLOCK_PIN 13
17
18// Define the array of leds
20
21void setup() {
22 //Serial.begin(9600);
23 //Serial.println("BLINK setup starting");
24
25 // Uncomment/edit one of the following lines for your leds arrangement.
26 // ## Clockless types ##
27 FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); // GRB ordering is assumed
28
29 //Serial.println("BLINK setup complete");
30 // FastLED.addLeds<SM16824E, DATA_PIN, RGB>(leds, NUM_LEDS); // RGB ordering (uses SM16824EController)
31 // FastLED.addLeds<SM16703, DATA_PIN, RGB>(leds, NUM_LEDS);
32 // FastLED.addLeds<TM1829, DATA_PIN, RGB>(leds, NUM_LEDS);
33 // FastLED.addLeds<TM1812, DATA_PIN, RGB>(leds, NUM_LEDS);
34 // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
35 // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
36 // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
37 // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
38 // FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);
39 // FastLED.addLeds<UCS1904, DATA_PIN, RGB>(leds, NUM_LEDS);
40 // FastLED.addLeds<UCS2903, DATA_PIN, RGB>(leds, NUM_LEDS);
41 // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
42 // FastLED.addLeds<WS2852, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
43 // FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
44 // FastLED.addLeds<GS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
45 // FastLED.addLeds<SK6812, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
46 // FastLED.addLeds<SK6822, DATA_PIN, RGB>(leds, NUM_LEDS);
47 // FastLED.addLeds<APA106, DATA_PIN, RGB>(leds, NUM_LEDS);
48 // FastLED.addLeds<PL9823, DATA_PIN, RGB>(leds, NUM_LEDS);
49 // FastLED.addLeds<SK6822, DATA_PIN, RGB>(leds, NUM_LEDS);
50 // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
51 // FastLED.addLeds<WS2813, DATA_PIN, RGB>(leds, NUM_LEDS);
52 // FastLED.addLeds<APA104, DATA_PIN, RGB>(leds, NUM_LEDS);
53 // FastLED.addLeds<WS2811_400, DATA_PIN, RGB>(leds, NUM_LEDS);
54 // FastLED.addLeds<GE8822, DATA_PIN, RGB>(leds, NUM_LEDS);
55 // FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
56 // FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);
57 // FastLED.addLeds<LPD1886, DATA_PIN, RGB>(leds, NUM_LEDS);
58 // FastLED.addLeds<LPD1886_8BIT, DATA_PIN, RGB>(leds, NUM_LEDS);
59 // ## Clocked (SPI) types ##
60 // FastLED.addLeds<LPD6803, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
61 // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
62 // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
63 // FastLED.addLeds<WS2803, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
64 // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
65 // FastLED.addLeds<P9813, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
66 // FastLED.addLeds<DOTSTAR, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
67 // FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
68 // FastLED.addLeds<SK9822, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
69}
70
71void loop() {
72 //Serial.println("BLINK");
73
74 // Turn the LED on, then pause
75 leds[0] = CRGB::Red;
76 FastLED.show();
77 delay(500);
78
79 // Now turn the LED off, then pause
80 leds[0] = CRGB::Black;
81 FastLED.show();
82 delay(500);
83}
CRGB leds[NUM_LEDS]
#define NUM_LEDS
#define DATA_PIN
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:74
central include file for FastLED, defines the CFastLED class/object
LED controller for WS2812 LEDs with GRB color order.
Definition FastLED.h:158
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
Definition crgb.h:679
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition crgb.h:567
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86