Skip to content

MoonModules/FastLED-MM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastLED-MM

FastLED-MM

FastLED effects and drivers running inside the projectMM module runtime on ESP32 devices.

What this is

FastLED-MM is a PlatformIO project that wires two things together:

  • FastLED — the pixel math and hardware driver library you already know. We use the latest master branch (The to be released FastLED 4 version) to get all the new features (e.g. FastLED Audio, Fixed point math, FastLED Channels API)
  • projectMM — a module runtime that adds a web UI, live control, dual-core dispatch, and persistent state on top of your effect

You write an effect that fills a shared CRGB leds[] array, exactly like a regular FastLED sketch. projectMM handles the rest: WiFi, ASP Async WebServer, WebSocket state push, REST API, and per-module timing.

projectMM is a brand new project, as is FastLED-MM (April 2026) and are both under heavy development so expect more features soon. So don't expect evrything to work fluently yet. Like the repo and log a FastLED-MM issue of you want to participate.

FastLED-MM is an example of using projectMM as a standalone library. Any ESP32 project can use projectMM to embed custom code in a full featured application. Log a projectMM issue if you need help.

If you like projectMM or FastLED-MM, give it a ⭐️, fork it or open an issue or pull request. It helps the projects grow, improve and get noticed.

What you get for free

Feature How
WiFi support  add your home network credentials in the UI and the device joins it; the AP stays up as a fallback
Web UI Adjust effect controls live in the browser
Live LED preview  see your panel animate in the browser before looking at the hardware
Log panel  real-time serial output in the browser tab, no USB required
Art-Net  receive and send Art-Net packages over the network and use in your FastLED pipeline
FastLED audio integration Run the brand new FastLED audio
ESP32 devices Currently ESP32dev and ESP32-S3, P4 follows soon
WebSocket push Control values update in the browser
Dual-core dispatch Effect on Core 0, FastLED.show() on Core 1
Persistent state All changes made survive reboots (LittleFS)
REST API GET /api/modules, POST /api/control, GET /api/system
Per-module timing See exact frame cost per effect in the web UI
ESP-IDF 5.5 Latest ESP32 firmware
Much more Much more to come

Read the user guide for more info

Quick start

1. Configure hardware

Edit main.cpp (VSCode/PlatformIO) or FastLED-MM.ino (Arduino IDE):

constexpr uint8_t  PIN      = 2;   // data pin
constexpr uint16_t WIDTH    = 16;  // panel width
constexpr uint16_t HEIGHT   = 16;  // panel height

When using the new FastLED channels API, this can also be added in a Module and can be set in runtime!

2. Flash

Upload in VSCode platformIO or Arduino IDE

3. Connect

  • Connect to the WiFi AP MM-<device-id> (password: moonlight)
  • Open http://4.3.2.1 in a browser
  • Connect to your local network in the Network module

The WaveRainbow2D effect is running. Use the web UI to adjust parameters live.

Adding your own effect

Create a new subclass of StatefulModule in src/main.cpp or FastLED-MM.ino:

class MyEffect : public StatefulModule {
public:
    const char* name()     const override { return "MyEffect"; }
    const char* category() const override { return "effect"; }
    uint8_t     preferredCore() const override { return 0; }

    void setup() override {
        addControl(speed_, "speed", "range", 1.0f, 20.0f);
    }

    void loop() override {
        uint8_t hue = millis() / 10;
        for (uint16_t i = 0; i < NUM_LEDS; ++i)
            leds[i] = CHSV(hue + i, 255, 255);
    }

    void teardown() override {}
    void healthReport(char* buf, size_t len) const override { snprintf(buf, len, "ok"); }
    size_t classSize() const override { return sizeof(*this); }

private:
    float speed_ = 5.0f;
};

Then , register the effect:

REGISTER_MODULE(MyEffect)

Optionally add the effect to run at boot in firstBoot()

static void firstBoot(ModuleManager& mm) {
    //...
    mm.addModule("WaveRainbow2DEffect", "fx1",     ep, ep, 0, "");
    //...
}

You can also add it in the UI using create module

Flash and use the web UI to add your effect to the pipeline.

Architecture

leds[]  (shared CRGB array in main.cpp)
     |
     +-- WaveRainbow2DEffect (Core 0) — writes pixels each tick
     |
     +-- FastLEDDriverModule  (Core 1) — calls FastLED.show() each tick

Both modules are StatefulModule subclasses managed by projectMM's Scheduler and ModuleManager. The shared array is the pixel handoff between effect and driver. In more advances scripts (as done in projectMM) double buffering, blending and such can be done to exploit parallelism

Roadmap

  • Audio module: a third StatefulModule that reads microphone data from the new FastLED Audio and publishes to KvStore for effects to react to. Can be dispatched in a separate task.
  • FastLED Channels API: use the newer FastLED::addLeds() channels API when targeting multi-strip setups.
  • Further tuning of src/main.cpp and FastLED-MM.ino moving any code which is not user-friendly into the projectMM library.

Requirements

  • PlatformIO or Arduino IDE
  • ESP32 (classic using 1.75MB partitions or S3; see platformio.ini for both supported environments)
  • FastLED-compatible LED strip (WS2812B by default; change in FastLEDDriver.h)

About

FastLED effects and drivers running inside the projectMM module runtime

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages