FastLED
3.10.9
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 UART-based WS2812 driver for ESP8266. It improves stability
5
// under Wi-Fi load by using hardware UART instead of bit-banging.
6
//
7
// #4944: FASTLED_ESP8266_UART is retired -- the driver is selected by template
8
// and the header is always available, so no define is needed. The legacy
9
// controller path below keeps working; the channel API path is shown for
10
// reference.
11
12
#include <FastLED.h>
13
14
#define NUM_LEDS 150
15
#define DATA_PIN 2
// ESP8266 UART1 TX (GPIO2)
16
17
CRGB
leds
[
NUM_LEDS
];
18
19
void
setup
() {
20
// Legacy controller path (no define needed now).
21
// Uses hardware UART for stable timing under Wi-Fi load.
22
FastLED
.addLeds<fl::UARTController_ESP8266,
GRB
>(
leds
,
NUM_LEDS
);
23
FastLED
.setBrightness(50);
24
25
// Channel API alternative -- select the UART engine by template:
26
// fl::ChannelConfigOf<fl::ClocklessChipset> cfg{clockless, span<CRGB>(leds, NUM_LEDS), GRB};
27
// FastLED.add<fl::Bus::UART, fl::ClocklessChipset>(cfg);
28
}
29
30
void
loop
() {
31
// Rainbow animation
32
fill_rainbow
(
leds
,
NUM_LEDS
, millis() / 10);
33
FastLED
.show();
34
delay(10);
35
}
leds
CRGB leds[1]
Definition
AnalogOutput.ino:26
NUM_LEDS
#define NUM_LEDS
Definition
Animartrix.ino:79
setup
void setup()
Definition
Esp8266Uart.ino:19
loop
void loop()
Definition
Esp8266Uart.ino:30
FastLED
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition
FastLED.cpp.hpp:94
fill_rainbow
void fill_rainbow(CRGB *targetArray, int numToFill, fl::u8 initialhue, fl::u8 deltahue=5) FL_NO_EXCEPT
Fill a range of LEDs with a rainbow of colors.
Definition
fill.cpp.hpp:30
GRB
constexpr EOrder GRB
Definition
eorder.h:19
CRGB
fl::CRGB CRGB
Definition
crgb.h:25
dox
dox
fastled
examples
Esp8266Uart
Esp8266Uart.ino
Generated on Mon Nov 2 2026 09:25:07 for FastLED by
1.13.2