FastLED
3.9.15
Loading...
Searching...
No Matches
Blur.ino
Go to the documentation of this file.
1
// UIDescription: This example shows how to blur a strip of LEDs. It uses the blur1d function to blur the strip and fadeToBlackBy to dim the strip. A bright pixel moves along the strip.
2
// Author: Zach Vorhies
3
4
#include <FastLED.h>
5
6
#define NUM_LEDS 64
7
#define DATA_PIN 3
// Change this to match your LED strip's data pin
8
#define BRIGHTNESS 255
9
10
CRGB
leds
[
NUM_LEDS
];
11
uint8_t
pos
= 0;
12
bool
toggle
=
false
;
13
14
void
setup
() {
15
FastLED
.addLeds<WS2812B,
DATA_PIN
,
GRB
>(
leds
,
NUM_LEDS
);
16
FastLED
.setBrightness(
BRIGHTNESS
);
17
}
18
19
void
loop
() {
20
// Add a bright pixel that moves
21
leds
[
pos
] =
CHSV
(
pos
* 2, 255, 255);
22
// Blur the entire strip
23
blur1d
(
leds
,
NUM_LEDS
, 172);
24
fadeToBlackBy
(
leds
,
NUM_LEDS
, 16);
25
FastLED
.show();
26
// Move the position of the dot
27
if
(
toggle
) {
28
pos
= (
pos
+ 1) %
NUM_LEDS
;
29
}
30
toggle
= !
toggle
;
31
delay(20);
32
}
NUM_LEDS
#define NUM_LEDS
Definition
Animartrix.ino:79
leds
fl::CRGB leds[NUM_LEDS]
Definition
Animartrix.ino:93
BRIGHTNESS
#define BRIGHTNESS
Definition
Animartrix.ino:73
pos
uint8_t pos
Definition
Blur.ino:11
setup
void setup()
Definition
Blur.ino:14
toggle
bool toggle
Definition
Blur.ino:12
loop
void loop()
Definition
Blur.ino:19
DATA_PIN
#define DATA_PIN
Definition
ClientReal.h:82
FastLED
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition
FastLED.cpp.hpp:75
fadeToBlackBy
void fadeToBlackBy(CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy)
Definition
colorutils.cpp.hpp:164
blur1d
void blur1d(fl::span< CRGB > leds, fract8 blur_amount) FL_NOEXCEPT
Definition
blur.h:150
GRB
constexpr EOrder GRB
Definition
eorder.h:19
CHSV
fl::hsv8 CHSV
Definition
chsv.h:11
CRGB
fl::CRGB CRGB
Definition
crgb.h:25
examples
Blur
Blur.ino
Generated on Tue Jun 16 2026 00:06:58 for FastLED by
1.13.2