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
15
16void 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
23void loop() {
24 // Rainbow animation
25 fill_rainbow(leds, NUM_LEDS, millis() / 10);
26 FastLED.show();
27 delay(10);
28}
#define NUM_LEDS
fl::CRGB leds[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_NOEXCEPT
Fill a range of LEDs with a rainbow of colors.
Definition fill.cpp.hpp:29
constexpr EOrder GRB
Definition eorder.h:19
fl::CRGB CRGB
Definition crgb.h:25