47#define FASTLED_RP2040_CLOCKLESS_PIO_AUTO 1
51#if !defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_RP2350)
52#error "This sketch requires RP2040 or RP2350 platform (Raspberry Pi Pico). Use bash compile rp2040 SpecialDrivers/RP instead."
67#define LEDS_PER_STRIP 100
92 while (!
Serial && millis() < 3000) {
95 Serial.println(
"\n\n=== RP2040/RP2350 Automatic Parallel WS2812 Example ===\n");
96 Serial.println(
"This example demonstrates automatic parallel grouping.\n");
106 Serial.println(
"Controller initialized!");
107 Serial.println(
"Automatic parallel grouping detected consecutive GPIO pins 2-5");
108 Serial.println(
"Using 4-lane parallel output with single PIO state machine and DMA channel");
110 Serial.println(
"Compare this with the manual Parallel_IO.ino example - same performance,");
111 Serial.println(
"but much simpler API! Just use standard FastLED.addLeds() calls.\n");
121 static uint32_t start_time = millis();
122 uint32_t elapsed = millis() - start_time;
124 for (
int strip = 0; strip < 4; strip++) {
125 CRGB* strip_leds =
nullptr;
127 case 0: strip_leds =
leds0;
break;
128 case 1: strip_leds =
leds1;
break;
129 case 2: strip_leds =
leds2;
break;
130 case 3: strip_leds =
leds3;
break;
134 uint8_t hue_offset = strip * 64;
138 uint8_t rotation = (elapsed / 50 + strip * 20) % 256;
150 static uint32_t last_stats = millis();
151 if (millis() - last_stats > 5000) {
152 last_stats = millis();
153 Serial.print(
"Frame time: ");
156 Serial.println(
"All 4 strips updating in parallel via automatic grouping");
166 if (amount == 0)
return;
171 for (
int i = 0; i < amount; i++) {
172 temp[i] = array[
length - amount + i];
176 for (
int i =
length - 1; i >= amount; i--) {
177 array[i] = array[i - amount];
181 for (
int i = 0; i < amount; i++) {
CRGB leds2[lengths[RedStrip]]
CRGB leds3[lengths[BlueStrip]]
CRGB leds1[lengths[GreenStrip]]
CRGB leds0[lengths[BlackStrip]]
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
void rotate(CRGB *array, int length, uint8_t amount)
Helper: Rotate array elements.
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.
fl::UISlider length("Length", 1.0f, 0.0f, 1.0f, 0.01f)