#include // Define constants for maximum LEDs #define MAX_LEDS 300 // Adjust based on your LED requirements // Wrapper class for dynamic LED strips class DynamicLedStrip { private: void* strip; // Pointer to the NeoPixelBus object int numLeds; // Number of LEDs String colorOrder; // Color order (for reference) public: DynamicLedStrip() : strip(nullptr), numLeds(0), colorOrder("") {} // Initialize the LED strip void initialize(int dataPin, int numLeds, const String& chipType, const String& colorOrder) { this->numLeds = numLeds; this->colorOrder = colorOrder; if (chipType == "WS2812" || chipType == "SK6812") { if (colorOrder == "GRB") { strip = new NeoPixelBus(numLeds, dataPin); } else if (colorOrder == "RGB") { strip = new NeoPixelBus(numLeds, dataPin); } else if (colorOrder == "BGR") { strip = new NeoPixelBus(numLeds, dataPin); } } if (strip) { static_cast*>(strip)->Begin(); } else { Serial.println("Unsupported chipset or color order!"); } } // Set all LEDs to a specific color void setColor(const RgbColor& color) { if (strip) { for (int i = 0; i < numLeds; i++) { static_cast*>(strip)->SetPixelColor(i, color); } static_cast*>(strip)->Show(); } } };