FastLED
3.9.15
Loading...
Searching...
No Matches
Blink.ino
#include <
Arduino.h
>
#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 1
// For led chips like WS2812, which have a data line, ground, and power, you just
// need to define PIN_DATA. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both PIN_DATA and CLOCK_PIN
// Clock pin only needed for SPI based chipsets when not using hardware SPI
#ifndef PIN_DATA
#define PIN_DATA 3
#endif
// PIN_DATA
#define CLOCK_PIN 13
// Define the array of leds
CRGB
leds
[
NUM_LEDS
];
void
setup
() {
Serial
.begin(115200);
Serial
.println(
"\n=============================================="
);
Serial
.println(
" BLINK.INO - Simple LED Blink Example"
);
Serial
.println(
"==============================================\n"
);
// Uncomment/edit one of the following lines for your leds arrangement.
// ## Clockless types ##
FastLED
.addLeds<NEOPIXEL,
PIN_DATA
>(
leds
,
NUM_LEDS
);
// GRB ordering is assumed
Serial
.println(
"✓ Blink setup complete - starting blink loop\n"
);
// FastLED.addLeds<SM16824E, PIN_DATA, RGB>(leds, NUM_LEDS); // RGB ordering (uses SM16824EController)
// FastLED.addLeds<SM16703, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1829, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1812, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1809, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1804, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1803, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1903, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1903B, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1904, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS2903, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS7604, PIN_DATA, GRB>(leds, NUM_LEDS); // 8-bit RGBW chipset (all platforms)
// FastLED.addLeds<UCS7604HD, PIN_DATA, GRB>(leds, NUM_LEDS); // 16-bit RGBW chipset (all platforms)
// FastLED.addLeds<WS2812, PIN_DATA, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<WS2852, PIN_DATA, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<WS2812B, PIN_DATA, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<WS2812BV5, PIN_DATA, RGB>(leds, NUM_LEDS); // GRB ordering is typical (newer V5 variant with tighter timing)
// FastLED.addLeds<WS2812BMiniV3, PIN_DATA, RGB>(leds, NUM_LEDS); // GRB ordering is typical (same timing as V5)
// FastLED.addLeds<GS1903, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SK6812, PIN_DATA, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<SK6822, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<APA106, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<PL9823, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SK6822, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2811, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2813, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<APA104, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2811_400, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GE8822, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GW6205, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GW6205_400, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LPD1886, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LPD1886_8BIT, PIN_DATA, RGB>(leds, NUM_LEDS);
// ## Clocked (SPI) types ##
// FastLED.addLeds<LPD6803, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<LPD8806, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<WS2801, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2803, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SM16716, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<P9813, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
// FastLED.addLeds<DOTSTAR, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
// FastLED.addLeds<APA102, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
// FastLED.addLeds<SK9822, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
}
void
loop
() {
// Turn the LED on, then pause
for
(
int
i = 0; i <
NUM_LEDS
; ++i) {
leds
[i] =
CRGB::Red
;
}
FastLED
.show();
delay
(500);
// Now turn the LED off, then pause
for
(
int
i = 0; i <
NUM_LEDS
; ++i) {
leds
[i] =
CRGB::Black
;
}
FastLED
.show();
delay
(100);
}
setup
void setup()
Definition
AnalogOutput.ino:65
loop
void loop()
Definition
AnalogOutput.ino:54
NUM_LEDS
#define NUM_LEDS
Definition
Animartrix.ino:79
PIN_DATA
#define PIN_DATA
Definition
Animartrix.ino:66
leds
fl::CRGB leds[NUM_LEDS]
Definition
Animartrix.ino:93
FastLED
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition
FastLED.cpp.hpp:75
arduino.h
CRGB
fl::CRGB CRGB
Definition
crgb.h:25
fl::delay
void delay(u32 ms, bool run_async=true) FL_NOEXCEPT
Public delay wrapper that keeps bare Arduino delay() preferred after using fl::delay; while still all...
Definition
delay.h:98
fl::CRGB::Red
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
Definition
crgb.h:622
fl::CRGB::Black
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition
crgb.h:510
Serial
#define Serial
Definition
serial.h:304
Generated on Tue Jun 16 2026 00:06:58 for FastLED by
1.13.2