/LEDuino

A powerful & flexible framework for mapping animation patterns to segments of an LED strip

Primary LanguageC++MIT LicenseMIT

Introduction

LEDuino is a powerful framework for defining animated patterns and mapping them to segments of an addressable LED strip controlled by an Arduino and FastLED. It consists of a collection of components which can be configured and combined in a declarative way to achieve a high level of customisation for your LED project.

LEDuino makes it easy to:

  • Define animation patterns (linear or 3D) which can be initialised with parameter values and colour palettes to adjust behaviour
  • Split a single LED strip into segments which can have patterns mapped to them independently
  • Map linear patterns to LED strip segments of different lengths, with automatic scaling and interpolation
  • Define the position of LEDs in space to allow spatial (3D) pattern mapping
  • Run multiple different pattern mapping configurations at the same time
  • Project a linear pattern along a vector in 3D space
  • Cycle through a sequence of pattern mapping configurations

Demonstration

The below video demonstrates the same simple moving, colour changing pulse pattern being mapped in 3 different ways to my Infinity Cube project.

InfinityCubePulseMapping

  1. Linear mapped to each axis in positive direction (same pattern repeated on all edges, all pulses originate in same corner and move outwards then terminate at the end)
  2. Same as #1 but one axis is reversed (looks like pulses are moving continuously and split or merge at corners).
  3. Spatial mapping - instead of being mapped to each edge separately, the pulse moves along a spatial vector from the top right to the bottom left corners of the cube, moving along the different edges as required

Requirements

  • Ardunio-compatible micocontroller. Bare minimum of 1kB of RAM and 16kB Flash for a basic linear pattern mapping configuration with a short LED strip. At least 8kB RAM, 64kB Flash and decent CPU is required for spatial pattern mapping or multiple concurrent patterns, depending on the complexity of your project and number of LEDs. A Teensy 3.1+ works great (can comfortably run complex pattern configurations on 300+ LEDs at 100+ FPS)
  • FastLED Library
  • Individually addressable LED strip compatible with FastLED (e.g. Neopixel, WS2801, WS2811, WS2812B, LPD8806, TM1809, and more)

Installation

LEDuino can be installed from the Arduino or PlatformIO library manager.

Otherwise, for manual installation:

  1. Download library from here.
  2. Unzip and move to Arduino library folder (e.g. Documents/Arduino/libraries/) or PlatformIO project local library folder (lib/)
  3. Rename folder to LEDuino
  4. Restart Arduino IDE

Getting Started

The best way to get started and learn how to use the library is to check out the tutorial.

Then take a look at the Reference for more in-depth details, and check out some Examples to see how it might work for your project.

Development & Support

This project is still under development and may be subject to changes of the API. I made it for my own personal use but figured could be quite useful to others as well, so it has not been tested extensively in many configurations. Please jump on the Discord to let me know what you think about it, or if you have any issues or ideas!

TODO / Future work:

  • Add more patterns and palettes
  • Integrate audio reactivity into the framework
  • Add support for easily configuring LED matrix displays
  • Bluetooth/remote control support