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
18
19void 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
30void loop() {
31 // Rainbow animation
32 fill_rainbow(leds, NUM_LEDS, millis() / 10);
33 FastLED.show();
34 delay(10);
35}
CRGB leds[1]
#define NUM_LEDS
void setup()
void loop()
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
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
constexpr EOrder GRB
Definition eorder.h:19
fl::CRGB CRGB
Definition crgb.h:25