FastLED
3.9.15
Loading...
Searching...
No Matches
Esp8266Uart.ino
Go to the documentation of this file.
1
// @filter: (platform is esp8266)
2
3
// ESP8266 UART Driver Test Example
4
// Demonstrates the opt-in UART-based WS2812 driver for ESP8266
5
// This driver improves stability under Wi-Fi load by using hardware UART
6
// instead of bit-banging.
7
8
#define FASTLED_ESP8266_UART
// Enable UART driver before including FastLED
9
#include <FastLED.h>
10
11
#define NUM_LEDS 150
12
#define DATA_PIN 2
// ESP8266 UART1 TX (GPIO2)
13
14
CRGB
leds
[
NUM_LEDS
];
15
16
void
setup
() {
17
// Initialize UART-based LED controller
18
// Uses hardware UART for stable timing under Wi-Fi load
19
FastLED
.addLeds<fl::UARTController_ESP8266,
GRB
>(
leds
,
NUM_LEDS
);
20
FastLED
.setBrightness(50);
21
}
22
23
void
loop
() {
24
// Rainbow animation
25
fill_rainbow
(
leds
,
NUM_LEDS
, millis() / 10);
26
FastLED
.show();
27
delay(10);
28
}
NUM_LEDS
#define NUM_LEDS
Definition
Animartrix.ino:79
leds
fl::CRGB leds[NUM_LEDS]
Definition
Animartrix.ino:93
setup
void setup()
Definition
Esp8266Uart.ino:16
loop
void loop()
Definition
Esp8266Uart.ino:23
FastLED
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition
FastLED.cpp.hpp:75
fill_rainbow
void fill_rainbow(CRGB *targetArray, int numToFill, fl::u8 initialhue, fl::u8 deltahue=5) FL_NOEXCEPT
Fill a range of LEDs with a rainbow of colors.
Definition
fill.cpp.hpp:29
GRB
constexpr EOrder GRB
Definition
eorder.h:19
CRGB
fl::CRGB CRGB
Definition
crgb.h:25
examples
Esp8266Uart
Esp8266Uart.ino
Generated on Tue Jun 16 2026 00:06:58 for FastLED by
1.13.2