FastLED
3.9.15
Loading...
Searching...
No Matches
Cylon.ino
#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 64
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806, define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 2
#define CLOCK_PIN 13
// Define the array of leds
CRGB
leds
[
NUM_LEDS
];
void
setup
() {
Serial
.begin(57600);
Serial
.println(
"resetting"
);
FastLED
.addLeds<WS2812,
DATA_PIN
,
RGB
>(
leds
,
NUM_LEDS
);
FastLED
.setBrightness(84);
}
void
fadeall
() {
for
(
int
i = 0; i <
NUM_LEDS
; i++) {
leds
[i].nscale8(250); } }
void
loop
() {
static
uint8_t
hue
= 0;
Serial
.print(
"x"
);
// First slide the led in one direction
for
(
int
i = 0; i <
NUM_LEDS
; i++) {
// Set the i'th led to red
leds
[i] =
CHSV
(
hue
++, 255, 255);
// Show the leds
FastLED
.show();
// now that we've shown the leds, reset the i'th led to black
// leds[i] = CRGB::Black;
fadeall
();
// Wait a little bit before we loop around and do it again
delay
(10);
}
Serial
.print(
"x"
);
// Now go in the other direction.
for
(
int
i = (
NUM_LEDS
)-1; i >= 0; i--) {
// Set the i'th led to red
leds
[i] =
CHSV
(
hue
++, 255, 255);
// Show the leds
FastLED
.show();
// now that we've shown the leds, reset the i'th led to black
// leds[i] = CRGB::Black;
fadeall
();
// Wait a little bit before we loop around and do it again
delay
(10);
}
}
setup
void setup()
Definition
AnalogOutput.ino:65
loop
void loop()
Definition
AnalogOutput.ino:54
NUM_LEDS
#define NUM_LEDS
Definition
Animartrix.ino:79
leds
fl::CRGB leds[NUM_LEDS]
Definition
Animartrix.ino:93
DATA_PIN
#define DATA_PIN
Definition
ClientReal.h:82
fadeall
void fadeall()
Definition
Cylon.ino:27
FastLED
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition
FastLED.cpp.hpp:75
hue
uint8_t hue
Definition
advanced.h:94
RGB
constexpr EOrder RGB
Definition
eorder.h:17
CHSV
fl::hsv8 CHSV
Definition
chsv.h:11
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::uint8_t
unsigned char uint8_t
Definition
s16x16x4.h:209
Serial
#define Serial
Definition
serial.h:304
Generated on Tue Jun 16 2026 00:06:58 for FastLED by
1.13.2